diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..8ec211d2 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ + +upload-dir +/.metadata/ +LOG_PATH_IS_UNDEFINED +META-INF +.jpd + +*.log diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..c69bddc7 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,33 @@ +# CHANGELOG + +### Updated - 2025-05-18 +- core @Entity 객체 이름 일괄 변경 + - JOIN 테이블은 `with` 에서 `has` 로 변경 + - 역할, 권한 정보에 `ADMIN_`, `FRONT_` 를 붙여 더 명시적인 이름으로 변경 + - typesafe 하지 않은 string 속성들 정리 + +### Updated - 2025-05-17 +- recycle-front 카카오 로그인 추가 (로컬 9001포트에서 동작) + +### Updated - 2025-05-14 +- properties 파일에서 yml 파일 사용으로 전환 + +### Updated - 2025-05-12 +- 전체 패키지 구조 변경 +- 공용 repository 패키지 생성 + +### Added - 2025-05-04 +- recycle-front 네이버 로그인 추가 (로컬 9001포트에서 동작) +- front user - 닉네임 및 회원가입 유형 속성 추가 + +### Added - 2025-04-23 +- recycle-api - Accept-Language 헤더 지원 및 en 다국어 프로퍼티 추가 + +### Added - 2025-03-13 +- recycle-api 모듈 구현 + +## [2.0.0] - 2025-02-05 +### Added +- recycle-2 버전 출시. +- model mapper 제거 - [model mapper 에서 생성자 패턴으로의 전환](https://code.etribe.co.kr/core-architect/recycle-2/-/blob/main/docs/DOC-000-CHANGELOG-VER2.md?ref_type=heads#model-mapper-%EC%97%90%EC%84%9C-%EC%83%9D%EC%84%B1%EC%9E%90-%ED%8C%A8%ED%84%B4%EC%9C%BC%EB%A1%9C%EC%9D%98-%EC%A0%84%ED%99%98) +- JPA Metamodel 도입 - [Typesafe 한 JPA 프로그래밍](https://code.etribe.co.kr/core-architect/recycle-2/-/blob/main/docs/DOC-000-CHANGELOG-VER2.md?ref_type=heads#jpa-metamodel-%EB%8F%84%EC%9E%85) \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..77feaf17 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,41 @@ +# 1단계: Maven을 사용하여 빌드 +FROM maven:3.8-openjdk-17 AS build + +ARG TARGET_MODULE + +# 작업 디렉터리 설정 +WORKDIR /app + +# 소스 디렉토리를 컨테이너에 복사 +COPY pom.xml . +COPY core ./core +COPY aws ./aws +COPY admin ./admin +COPY front ./front +COPY api ./api + +# Maven을 이용해 프로젝트 빌드 +RUN mvn --projects $TARGET_MODULE --also-make package -Dmaven.test.skip=true + +# 2단계: JAR 파일을 실행할 수 있는 기본 이미지 +FROM openjdk:17-jdk-slim + +ARG TARGET_MODULE +ARG PROFILE +ENV SPRING_PROFILE=$PROFILE + +# 타임존 설정 +ENV TZ=Asia/Seoul +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +# 작업 디렉터리 설정 +WORKDIR /app + +# 1단계에서 빌드된 JAR 파일을 복사 +COPY --from=build /app/$TARGET_MODULE/target/*.jar app.jar + +# 포트 노출 (스프링 부트 기본 포트) +EXPOSE 8080 + +# 커맨드 +CMD ["sh", "-c", "exec java -Dspring.profiles.active=${SPRING_PROFILE} -jar /app/app.jar"] \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..dfc221c7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 YoungMok Kim + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 50750132..e38cd5c6 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,309 @@ -# korea research - - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - ``` -cd existing_repo -git remote add origin http://code.etribe.co.kr/korea-research/korea-research.git -git branch -M main -git push -uf origin main +┬─┐┌─┐┌─┐┬ ┬┌─┐┬ ┌─┐ +├┬┘├┤ │ └┬┘│ │ ├┤ +┴└─└─┘└─┘ ┴ └─┘┴─┘└─┘ - framework for spring developers exploring JPA + + _____\ _______ + / \ | /\ + /_______/ |_____/ \ + | \ / / / + \ \ \/ / + \ / \__/_ + \/ ____ /\ + / \ / \ + /\ \ / / + \ \/ / + \___\__/ + +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. ``` -## Integrate with your tools +## Prerequisites -- [ ] [Set up project integrations](http://code.etribe.co.kr/korea-research/korea-research/-/settings/integrations) +* JDK 17+ +* Maven -## Collaborate with your team +## Structure -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) +recycle 은 `core` 모듈을 기반으로 한 `admin`, `front`, `api` 어플리케이션으로 구성되어 있다. -## Test and Deploy +```shell +. +|-- README.md +|-- admin # 관리자 어플리케이션 +| |-- pom.xml +| |-- src +| `-- target +|-- api # API 모듈 (JWT 토큰 기반 인증) +| |-- pom.xml +| |-- src +| `-- target +|-- aws # AWS 서비스 전략(strategy) 모듈 +| |-- pom.xml +| |-- src +| `-- target +|-- core # 공통 모듈 +| |-- pom.xml +| |-- src +| `-- target +|-- front # 프론트 어플리케이션 +| |-- pom.xml +| |-- src +| `-- target +`-- pom.xml +``` -Use the built-in continuous integration in GitLab. +⚡ AWS S3 업로드를 이용하지 않는다면, pom.xml 에서 `aws`모듈 관련 내용을 삭제하면 된다. +⚡ `admin`, `front`, `api` 중 실제 프로젝트에서 사용할 모듈만 남기고 삭제해주세요. -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) +✔️ Dockerfile 과 .gitlab-ci.yml 은 삭제해주세요 : ) recycle demo 용이기에 여려분의 프로젝트에서는 의미가 없습니다. -*** +recycle 의 demo 가 궁금하다면 아래 URL 에서 확인 해주세요. +- `recycle-admin` - https://recycle-admin.etribe.co.kr 계정정보 (recycle-super/recycle1@#$) +- `recycle-api` - https://recycle-api.etribe.co.kr/swagger-ui/index.html +- `recycle-front` - https://recycle-front.etribe.co.kr/ 계정정보 (generalUser/generalUser1@#$) -# Editing this README -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template. +## VM Options -## Suggestions for a good README +프레임워크 실행 시 필요한 자바 VM 옵션은 아래와 같다. -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. +| VM 변수 | 설명 | 설정 값 | 필수여부 | +|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|-------------------------|------| +| -Dspring.profiles.active | Spring active 프로파일 | local, dev, prod | Y | +| **-Dspring.datasource.driver-class-name** (2023-03-25 추가) | JDBC Driver. 없다면 JDBC URL을 기준으로 JPA가 판단한다. | jdbc 드라이버 | Y | +| **-Dspring.datasource.url** (2023-03-25 추가) | JDBC URL | jdbc url | N | +| **-Dspring.datasource.username** (2023-03-25 추가) | DB Username | DB 사용자 | Y | +| **-Dspring.datasource.password** (2023-03-25 추가) | DB Password | DB 패스워드 | Y | +| -Dapp.initData.core | 어플리케이션 초기 구동에 필요한 필수 데이터 생성여부 | true, false | N | +| -Dspring.jpa.hibernate.ddl-auto | JPA DDL 옵션 | update, create 등등 | Y | +| -Dspring.jpa.properties.hibernate.show_sql | JPA SQL 로그 보이기 | true, false | N | +| -Dlogging.level.org.hibernate.orm.jdbc.bind | JPA 파라미터 바인딩 로그 보이기 | trace (로그보임), info(숨기기) | N | +| -Dpath.upload.public | 파일 업로드 경로 | 기본값 (~/upload/public) | N | +| -Dpath.upload.tmpdir | 임시 파일 업로드 경로 | 기본값 (~/upload/tmpdir) | N | +| -Dlogging.file.path | 로그 파일 생성 경로 | 기본값 (~/logs) | N | +| -Dfile.encoding | JVM 속성 | `UTF-8` | Y | +| -Djava.net.preferIPv4Stack | JVM 속성. 클라이언트 IP체크시 IPv4 형식을 사용하기 위함. | true | Y | +| -Dcom.amazonaws.sdk.disableEc2Metadata | aws 모듈의 ec2 metadata 전송 끄기 | true | N | +| **-Dserver.port** (2023-03-25 추가) | 서버 포트 (없다면 기본 8080) | 원하는 port | N | +| **-Dserver.forward-headers-strategy** (2023-03-25 추가) | 프록시 서버(nginx, apache)에 정의된 `X-Forward-For`, `X-Forwarded-Proto` 설정값을 이용하려면 `native` 로 설정해주면 된다. (내장 컨테이너를 사용하는 경우에만 유효) | `native` | N | -## Name -Choose a self-explaining name for your project. +### VM Options 예시 +#### `admin`, `front`, `api` 모두 사용가능합니다. +``` +-Dspring.profiles.active=local +-Dapp.initData.core=false +-Dspring.jpa.hibernate.ddl-auto=update +-Dfile.encoding=UTF-8 +-Djava.net.preferIPv4Stack=true +-Dcom.amazonaws.sdk.disableEc2Metadata=true +-Dspring.jpa.properties.hibernate.show_sql=true +-Dlogging.level.org.hibernate.orm.jdbc.bind=info +-Dserver.port=8080 +-Dserver.forward-headers-strategy=native +-Dlogging.level.org.springframework.security=DEBUG +-Dspring.datasource.url=jdbc:h2:~/h2/app-h2;AUTO_SERVER=TRUE +-Dspring.datasource.username=sa +-Dspring.datasource.password= +``` -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. +## JDBC 및 데이터 핸들링 구성 옵션 -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. +### JDBC 연결 설정 -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. +스프링부트의 JDBC 설정 방식을 그대로 이용한다. JDBC 연결을 맺을 DB Vendor 와 JNDI 이용여부 등은 프로젝트 상황에 맞게 설정하면 된다. -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. +recycle 은 `H2`를 기본으로 탑재하고 있다. `H2` 를 이용하면 로컬 개발환경에서 아래와 같은 장점을 얻는다. -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. +* 설치 과정이 필요없다. (Maven dependency 에 기술되어 각자 환경에 이미 탑재됨) +* 가볍고 빠르며 JDBC API 를 지원하는 오픈소스이다. +* ANSI SQL 을 지원하기에 범용성이 뛰어남. -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. +``` +-Dspring.datasource.url=jdbc:h2:~/h2/app-h2;AUTO_SERVER=TRUE +-Dspring.datasource.username=sa +-Dspring.datasource.password= +``` -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. +recycle 이 구동되면서 사용자 홈디렉토리에 밑에 /h2/app-h2.mv 파일을 생성합니다. 생성된 파일을 db 클라이언트 툴에서 접속하는 법은 +이 [문서](https://javanitto.tistory.com/37) 를 참고하세요. -## Contributing -State if you are open to contributions and what your requirements are for accepting them. +⚡️ recycle 은 로컬 개발 환경에서 각자의 DB를 이용한 작업을 지향합니다. 테이블과 데이터를 마음대로 삭제/추가하며 개발할 수 있고, 개발/스테이징/운영 환경 같은 공용 공간에 필요한 정보만 커밋할 +수 있기 +때문입니다 : ) -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. +### ddl-auto -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. +```shell +-Dspring.jpa.hibernate.ddl-auto=update # update | create | none | validate +``` -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. +**JPA**가 ddl 을 다루는 방식을 정의한다. 엔티티 변경이 많은 개발 시점에는 `update`, `create`를, +엔티티 혹은 데이터가 함부로 변경되서는 안되는 운영 환경에서는 `none`, `validate` 등을 지정해준다. ( +참고: [ddl-auto 옵션 설명](https://smpark1020.tistory.com/140?category=857916)) -## License -For open source projects, say how it is licensed. +### show_sql + +```shell +-Dspring.jpa.properties.hibernate.show_sql=true # true | false +``` + +JPA SQL 로그 보이기 여부 + +### descriptor.sql + +```shell +-Dlogging.level.org.hibernate.orm.jdbc.bind=trace # trace | info | debug and etc +``` + +JPA 파라미터 바인딩 로그 보이기. trace 일 때 where 조건절 등 바인딩된 파라미터 정보 확인이 가능. + +### app.initData.core + +```shell +-Dapp.initData.core=true # true | false +``` + +어플리케이션 초기 구동에 필요한 필수 데이터 생성여부. 공통코드, 메뉴 정보 및 개발에 필요한 기반 데이터 등이 여기에 해당한다. +InitAdminData, InitUriFrontData 등 *ApplicationRunner* 구현체에서 내용을 확인할 수 있다. + +## LOG 생성 옵션 + +### logging.file.path + +```shell +-Dlogging.file.path=~/logs # 기본값 ${user.home}/logs +``` + +로그 파일 생성 경로를 지정한다. 지정된 경로에 아래와 같은 로그 파일이 생성된다. + +```shell +admin-app.log # 어드민 전체 로그 +admin-app-ERROR.log # 어드민 로그 중 ERROR 부분 필터링 +front-app.log # 프론트 전체 로그 +front-app-ERROR.log # 프론트 로그 중 ERROR 부분 필터링 +``` + +## File 구성 옵션 + +### 파일 업로드 + +```shell +-Dpath.upload.public=~/upload/public # 파일 업로드 경로 +-Dpath.upload.tmpdir=~/upload/tmpdir # tmp 디렉토리 경로 +``` + +파일 업로드 경로가 지정되면 사용자가 업로드한 파일은 이 경로를 기준으로 `주제`/`년월일` 폴더 아래에 저장됩니다. +tmpdir 은 서블릿 컨테이너가 multipart 파일 업로드 시 대용량 처리를 위해 임시파일을 저장하는 공간입니다. + +파일 시스템 외에 AWS S3 로도 업로드해야 한다면, 아래 AWS CLI 를 이용하기 위한 정보를 제공해주어야 합니다. + +```shell +-Dapp.aws.s3.accessKey=AKIAZF27HETWNITZBZOF # AMI 에서 발급한 사용자 엑세스 키 +-Dapp.aws.s3.secretKey=IhnTG0X7Wav8ak3cbYR1l8UAjL+gbnXdWJRM11cx # AMI 에서 발급한 사용자 시크릿 키 +-Dapp.aws.s3.bucketName=etribe # S3 버킷 이름 +-Dapp.aws.s3.bucketFolder=/recycle/upload # S3 버킷 디렉토리 +-Dapp.aws.s3.domain=dixjkmptx5pkm.cloudfront.net # S3 혹은 cloudfront 도메인 +``` + +🔑 위 accessKey 정보는 제가 만든 임시 정보이며, recycle 데모용으로만 사용되니 참고해주세요. + +💡 recycle 은 파일 시스템 업로드와 S3 업로드를 사용 목적에 맞게 선택할 수 있는 유연성을 제공합니다. +`FileUploadType`은 파일 업로드가 필요한 주제 도메인들이 정의된 enum 객체입니다. 여기 기술된 `FileStorageType` 속성에 따라 파일 업로드 경로가 결정됩니다. + +### 파일 참조 + +업로드된 파일은 참조될 수 있어야 합니다. `fileUrlPortIn`는 파일이 파일 시스템에 있든 S3 에 있든 정확한 참조 URL 을 전달해주는 인터페이스입니다. + +```java +// 참조 URL 전달 - inline 방식 +fileUrlPortIn.getInline( + uploadFile.getType().getFileStorageType(), + uploadFile.getPath(), + uploadFile.getName()); + +// 참조 URL 전달 - attachment 방식 + fileUrlPortIn.getAttachment( + uploadFile.getType().getFileStorageType(), + uploadFile.getId()); +``` + +`inline` 과 `attachment` 는 응답 헤더의 content-disposition 속성 값을 의미합니다. +업로드된 파일은 사용자에게 전달할 때 `inline` 과 `attachment` 두 방식 중 요건에 맞게 사용하면 됩니다. + +## 코드 작성 규칙 (coding conventions) + +기본 패키지 구조는 [포트 앤 어댑터 패턴](https://coco-log.tistory.com/205)에 기반해 구성됩니다. + +![img](./docs/img/port-adapter.jpg) + +getArticles 라는 주제(subject) 패키지 하부를 구성하는 ports 와 adapters 패키지를 주의깊게 봐주세요. + +``` +# 주제(subject) +getArticles +|-- adapters +| |-- persistence +| | |-- GetArticlesDao.java # 포트아웃 구현체 +| `-- web +| |-- GetArticlesController.java +| `-- model +| `-- GetArticlesReqVO.java +`-- ports + |-- GetArticlesPortIn.java # 포트인 인터페이스 + |-- GetArticlesPortOut.java # 포트아웃 인터페이스 + `-- application + |-- GetArticlesService.java # 포트인 구현체 + `-- domain + |-- GetArticles.java + `-- GetArticlesCmd.java +``` + +* ports 는 비지니스 로직을 담는 application 레이어가 위치한 곳입니다. application 은 `포트인` 인터페이스를 통해 호출되며 `포트아웃` 인터페이스를 호출해 결과를 얻습니다. +* application 은 누가 `포트인`을 호출하는지 신경쓰지 않습니다. **자신이 호출하는 `포트아웃`의 구현체에 대해서도 모릅니다.** 이를 통해 application 은 다른 계층(web, + persistence)과 관계없는 독립적인 레이어가 됩니다. +* adapters/web 은 사용자 요청을 처리하는 controller 레이어가 위치한 곳입니다. `포트인` 인터페이스를 호출하는 클라이언트로 해당 규격을 맞춘 어뎁터(adapter) 이며, * + *application 에 종속적입니다.** +* adapters/persistence 는 영속화(persistence) 레이어가 위치한 곳입니다. mybatis, jpa 등 다양한 ORM 기술을 이용하여 `포트아웃` 인터페이스를 구현합니다. `포트아웃` 규격을 + 맞춘 어뎁터이며, **application 에 종속적입니다.** + +### 자동화 스캐폴딩 (scaffolding) 도구 소개 + +위 패키지 구조와 인터페이스 및 구현체를 일일이 타이핑하며 생성할 필요는 없습니다. [BASC](https://code.etribe.co.kr/core-architect/basc) 스캐폴팅 도구가 자동생성 +해줍니다. + +### Best Practices + +코드 작성 규칙에 맞게 구현된 가장 좋은 예는 관리자의 **예제 게시판**입니다. 새로운 버전에 맞춰 모든 코드들이 재작성되었고 아래 고민들에 대한 해법이 녹아있습니다. + +1. 패키지 구조 및 클래스 명칭을 어떻게 잡아야 할까? +2. 브라우저 history 를 잘 유지하면서 back 버튼 이슈를 발생시키지 않는 구현방식은 무엇일까? +3. form submit 과 ajax 호출. 어떤 방식이 더 유용할까? +4. 사용자 입력값을 검증하고 문제점을 표현하는 가장 좋은 방법은? +5. 어떻게 restfull 한 서비스를 구현할 수 있을까? (GET/POST/PUT/PATCH/DELETE) +6. 새로운 파일 업로드 방식. + +## PACKAGING + +배포방식 설정을 위해 두가지 maven 프로파일을 제공한다. + +* `jar` (default) +* `war` Jeus, WebLogic, Tomcat 등 별도 외장 컨테이너 이용시 사용 + +maven 빌드 시 프로파일을 지정하지 않으면 기본 `jar` 프로파일로 동작하고, `war` 의 경우 명시적인 지정이 필요하다. + +아래는 admin 빌드시 `war` 프로파일을 지정한 예시이다. + +```shell +$ mvn --projects admin --also-make clean package -DskipTests -P war + +# 빌드 후, admin/target 디렉토리에 war 가 생성된걸 확인할 수 있다. +$ ll admin/target +-rw-r--r-- 1 user 197121 94905770 4월 22 09:59 admin-0.0.1-SNAPSHOT.war +``` -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. diff --git a/admin/.gitignore b/admin/.gitignore new file mode 100644 index 00000000..549e00a2 --- /dev/null +++ b/admin/.gitignore @@ -0,0 +1,33 @@ +HELP.md +target/ +!.mvn/wrapper/maven-wrapper.jar +!**/src/main/**/target/ +!**/src/test/**/target/ + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +build/ +!**/src/main/**/build/ +!**/src/test/**/build/ + +### VS Code ### +.vscode/ diff --git a/admin/.mvn/wrapper/maven-wrapper.jar b/admin/.mvn/wrapper/maven-wrapper.jar new file mode 100644 index 00000000..c1dd12f1 Binary files /dev/null and b/admin/.mvn/wrapper/maven-wrapper.jar differ diff --git a/admin/.mvn/wrapper/maven-wrapper.properties b/admin/.mvn/wrapper/maven-wrapper.properties new file mode 100644 index 00000000..b7cb93e7 --- /dev/null +++ b/admin/.mvn/wrapper/maven-wrapper.properties @@ -0,0 +1,2 @@ +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip +wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar diff --git a/admin/mvnw b/admin/mvnw new file mode 100644 index 00000000..8a8fb228 --- /dev/null +++ b/admin/mvnw @@ -0,0 +1,316 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. +# ---------------------------------------------------------------------------- + +# ---------------------------------------------------------------------------- +# Maven Start Up Batch script +# +# Required ENV vars: +# ------------------ +# JAVA_HOME - location of a JDK home dir +# +# Optional ENV vars +# ----------------- +# M2_HOME - location of maven2's installed home dir +# MAVEN_OPTS - parameters passed to the Java VM when running Maven +# e.g. to debug Maven itself, use +# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +# MAVEN_SKIP_RC - flag to disable loading of mavenrc files +# ---------------------------------------------------------------------------- + +if [ -z "$MAVEN_SKIP_RC" ] ; then + + if [ -f /usr/local/etc/mavenrc ] ; then + . /usr/local/etc/mavenrc + fi + + if [ -f /etc/mavenrc ] ; then + . /etc/mavenrc + fi + + if [ -f "$HOME/.mavenrc" ] ; then + . "$HOME/.mavenrc" + fi + +fi + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +mingw=false +case "`uname`" in + CYGWIN*) cygwin=true ;; + MINGW*) mingw=true;; + Darwin*) darwin=true + # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home + # See https://developer.apple.com/library/mac/qa/qa1170/_index.html + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + export JAVA_HOME="`/usr/libexec/java_home`" + else + export JAVA_HOME="/Library/Java/Home" + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +if [ -z "$M2_HOME" ] ; then + ## resolve links - $0 may be a link to maven's home + PRG="$0" + + # need this for relative symlinks + while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG="`dirname "$PRG"`/$link" + fi + done + + saveddir=`pwd` + + M2_HOME=`dirname "$PRG"`/.. + + # make it fully qualified + M2_HOME=`cd "$M2_HOME" && pwd` + + cd "$saveddir" + # echo Using m2 at $M2_HOME +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --unix "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# For Mingw, ensure paths are in UNIX format before anything is touched +if $mingw ; then + [ -n "$M2_HOME" ] && + M2_HOME="`(cd "$M2_HOME"; pwd)`" + [ -n "$JAVA_HOME" ] && + JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`" +fi + +if [ -z "$JAVA_HOME" ]; then + javaExecutable="`which javac`" + if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then + # readlink(1) is not available as standard on Solaris 10. + readLink=`which readlink` + if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then + if $darwin ; then + javaHome="`dirname \"$javaExecutable\"`" + javaExecutable="`cd \"$javaHome\" && pwd -P`/javac" + else + javaExecutable="`readlink -f \"$javaExecutable\"`" + fi + javaHome="`dirname \"$javaExecutable\"`" + javaHome=`expr "$javaHome" : '\(.*\)/bin'` + JAVA_HOME="$javaHome" + export JAVA_HOME + fi + fi +fi + +if [ -z "$JAVACMD" ] ; then + if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + else + JAVACMD="`\\unset -f command; \\command -v java`" + fi +fi + +if [ ! -x "$JAVACMD" ] ; then + echo "Error: JAVA_HOME is not defined correctly." >&2 + echo " We cannot execute $JAVACMD" >&2 + exit 1 +fi + +if [ -z "$JAVA_HOME" ] ; then + echo "Warning: JAVA_HOME environment variable is not set." +fi + +CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher + +# traverses directory structure from process work directory to filesystem root +# first directory with .mvn subdirectory is considered project base directory +find_maven_basedir() { + + if [ -z "$1" ] + then + echo "Path not specified to find_maven_basedir" + return 1 + fi + + basedir="$1" + wdir="$1" + while [ "$wdir" != '/' ] ; do + if [ -d "$wdir"/.mvn ] ; then + basedir=$wdir + break + fi + # workaround for JBEAP-8937 (on Solaris 10/Sparc) + if [ -d "${wdir}" ]; then + wdir=`cd "$wdir/.."; pwd` + fi + # end of workaround + done + echo "${basedir}" +} + +# concatenates all lines of a file +concat_lines() { + if [ -f "$1" ]; then + echo "$(tr -s '\n' ' ' < "$1")" + fi +} + +BASE_DIR=`find_maven_basedir "$(pwd)"` +if [ -z "$BASE_DIR" ]; then + exit 1; +fi + +########################################################################################## +# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +# This allows using the maven wrapper in projects that prohibit checking in binary data. +########################################################################################## +if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found .mvn/wrapper/maven-wrapper.jar" + fi +else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..." + fi + if [ -n "$MVNW_REPOURL" ]; then + jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + else + jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + fi + while IFS="=" read key value; do + case "$key" in (wrapperUrl) jarUrl="$value"; break ;; + esac + done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties" + if [ "$MVNW_VERBOSE" = true ]; then + echo "Downloading from: $jarUrl" + fi + wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" + if $cygwin; then + wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"` + fi + + if command -v wget > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found wget ... using wget" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + else + wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath" + fi + elif command -v curl > /dev/null; then + if [ "$MVNW_VERBOSE" = true ]; then + echo "Found curl ... using curl" + fi + if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then + curl -o "$wrapperJarPath" "$jarUrl" -f + else + curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f + fi + + else + if [ "$MVNW_VERBOSE" = true ]; then + echo "Falling back to using Java to download" + fi + javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java" + # For Cygwin, switch paths to Windows format before running javac + if $cygwin; then + javaClass=`cygpath --path --windows "$javaClass"` + fi + if [ -e "$javaClass" ]; then + if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Compiling MavenWrapperDownloader.java ..." + fi + # Compiling the Java class + ("$JAVA_HOME/bin/javac" "$javaClass") + fi + if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then + # Running the downloader + if [ "$MVNW_VERBOSE" = true ]; then + echo " - Running MavenWrapperDownloader.java ..." + fi + ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR") + fi + fi + fi +fi +########################################################################################## +# End of extension +########################################################################################## + +export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"} +if [ "$MVNW_VERBOSE" = true ]; then + echo $MAVEN_PROJECTBASEDIR +fi +MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS" + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$M2_HOME" ] && + M2_HOME=`cygpath --path --windows "$M2_HOME"` + [ -n "$JAVA_HOME" ] && + JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && + CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$MAVEN_PROJECTBASEDIR" ] && + MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"` +fi + +# Provide a "standardized" way to retrieve the CLI args that will +# work with both Windows and non-Windows executions. +MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@" +export MAVEN_CMD_LINE_ARGS + +WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +exec "$JAVACMD" \ + $MAVEN_OPTS \ + $MAVEN_DEBUG_OPTS \ + -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \ + "-Dmaven.home=${M2_HOME}" \ + "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \ + ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@" diff --git a/admin/mvnw.cmd b/admin/mvnw.cmd new file mode 100644 index 00000000..1d8ab018 --- /dev/null +++ b/admin/mvnw.cmd @@ -0,0 +1,188 @@ +@REM ---------------------------------------------------------------------------- +@REM Licensed to the Apache Software Foundation (ASF) under one +@REM or more contributor license agreements. See the NOTICE file +@REM distributed with this work for additional information +@REM regarding copyright ownership. The ASF licenses this file +@REM to you under the Apache License, Version 2.0 (the +@REM "License"); you may not use this file except in compliance +@REM with the License. You may obtain a copy of the License at +@REM +@REM https://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, +@REM software distributed under the License is distributed on an +@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +@REM KIND, either express or implied. See the License for the +@REM specific language governing permissions and limitations +@REM under the License. +@REM ---------------------------------------------------------------------------- + +@REM ---------------------------------------------------------------------------- +@REM Maven Start Up Batch script +@REM +@REM Required ENV vars: +@REM JAVA_HOME - location of a JDK home dir +@REM +@REM Optional ENV vars +@REM M2_HOME - location of maven2's installed home dir +@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands +@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending +@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven +@REM e.g. to debug Maven itself, use +@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 +@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files +@REM ---------------------------------------------------------------------------- + +@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' +@echo off +@REM set title of command window +title %0 +@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' +@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% + +@REM set %HOME% to equivalent of $HOME +if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") + +@REM Execute a user defined script before this one +if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre +@REM check for pre script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %* +if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %* +:skipRcPre + +@setlocal + +set ERROR_CODE=0 + +@REM To isolate internal variables from possible post scripts, we use another setlocal +@setlocal + +@REM ==== START VALIDATION ==== +if not "%JAVA_HOME%" == "" goto OkJHome + +echo. +echo Error: JAVA_HOME not found in your environment. >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +:OkJHome +if exist "%JAVA_HOME%\bin\java.exe" goto init + +echo. +echo Error: JAVA_HOME is set to an invalid directory. >&2 +echo JAVA_HOME = "%JAVA_HOME%" >&2 +echo Please set the JAVA_HOME variable in your environment to match the >&2 +echo location of your Java installation. >&2 +echo. +goto error + +@REM ==== END VALIDATION ==== + +:init + +@REM Find the project base dir, i.e. the directory that contains the folder ".mvn". +@REM Fallback to current working directory if not found. + +set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% +IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir + +set EXEC_DIR=%CD% +set WDIR=%EXEC_DIR% +:findBaseDir +IF EXIST "%WDIR%"\.mvn goto baseDirFound +cd .. +IF "%WDIR%"=="%CD%" goto baseDirNotFound +set WDIR=%CD% +goto findBaseDir + +:baseDirFound +set MAVEN_PROJECTBASEDIR=%WDIR% +cd "%EXEC_DIR%" +goto endDetectBaseDir + +:baseDirNotFound +set MAVEN_PROJECTBASEDIR=%EXEC_DIR% +cd "%EXEC_DIR%" + +:endDetectBaseDir + +IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig + +@setlocal EnableExtensions EnableDelayedExpansion +for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a +@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% + +:endReadAdditionalConfig + +SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" +set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" +set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain + +set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + +FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( + IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B +) + +@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central +@REM This allows using the maven wrapper in projects that prohibit checking in binary data. +if exist %WRAPPER_JAR% ( + if "%MVNW_VERBOSE%" == "true" ( + echo Found %WRAPPER_JAR% + ) +) else ( + if not "%MVNW_REPOURL%" == "" ( + SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar" + ) + if "%MVNW_VERBOSE%" == "true" ( + echo Couldn't find %WRAPPER_JAR%, downloading it ... + echo Downloading from: %DOWNLOAD_URL% + ) + + powershell -Command "&{"^ + "$webclient = new-object System.Net.WebClient;"^ + "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ + "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ + "}"^ + "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ + "}" + if "%MVNW_VERBOSE%" == "true" ( + echo Finished downloading %WRAPPER_JAR% + ) +) +@REM End of extension + +@REM Provide a "standardized" way to retrieve the CLI args that will +@REM work with both Windows and non-Windows executions. +set MAVEN_CMD_LINE_ARGS=%* + +%MAVEN_JAVA_EXE% ^ + %JVM_CONFIG_MAVEN_PROPS% ^ + %MAVEN_OPTS% ^ + %MAVEN_DEBUG_OPTS% ^ + -classpath %WRAPPER_JAR% ^ + "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^ + %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* +if ERRORLEVEL 1 goto error +goto end + +:error +set ERROR_CODE=1 + +:end +@endlocal & set ERROR_CODE=%ERROR_CODE% + +if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost +@REM check for post script, once with legacy .bat ending and once with .cmd ending +if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat" +if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd" +:skipRcPost + +@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' +if "%MAVEN_BATCH_PAUSE%"=="on" pause + +if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE% + +cmd /C exit /B %ERROR_CODE% diff --git a/admin/pom.xml b/admin/pom.xml new file mode 100644 index 00000000..487ecba9 --- /dev/null +++ b/admin/pom.xml @@ -0,0 +1,43 @@ + + + admin + + + + spring-boot-maven-plugin + + true + + org.springframework.boot + 3.4.0 + + + + + + aws + app.module + 0.0.1-SNAPSHOT + + + core + app.module + 0.0.1-SNAPSHOT + + + Admin project + 4.0.0 + admin + ${packaging.type} + + + app.module + app.module + 0.0.1-SNAPSHOT + + + 0.0.1-SNAPSHOT + + diff --git a/admin/src/main/java/app/module/admin/AdminApplication.java b/admin/src/main/java/app/module/admin/AdminApplication.java new file mode 100644 index 00000000..f81aec27 --- /dev/null +++ b/admin/src/main/java/app/module/admin/AdminApplication.java @@ -0,0 +1,30 @@ +package app.module.admin; + +import org.mybatis.spring.annotation.MapperScan; +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; +import org.springframework.cache.annotation.EnableCaching; +import org.springframework.context.annotation.ComponentScan; + +@SpringBootApplication +@EnableCaching +@ComponentScan(basePackages = "app.module") +public class AdminApplication extends SpringBootServletInitializer { + + public static void main(String[] args) { + SpringApplication.run(AdminApplication.class, args); + } + + /** + * maven jar 배포시 필요없지만, war 배포를 선택한 경우 configure 오버라이드가 필요하기에 선언. + * + * @param builder + * @return + */ + @Override + protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) { + return builder.sources(AdminApplication.class); + } +} diff --git a/admin/src/main/java/app/module/admin/config/adapters/web/interceptor/AdminURIInterceptor.java b/admin/src/main/java/app/module/admin/config/adapters/web/interceptor/AdminURIInterceptor.java new file mode 100644 index 00000000..91c100f5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/adapters/web/interceptor/AdminURIInterceptor.java @@ -0,0 +1,101 @@ +package app.module.admin.config.adapters.web.interceptor; + +import app.module.core.config.adapters.web.interceptor.model.URITopTierVO; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.exception.NoMatchingURIException; +import app.module.core.config.application.util.CommonUtil; +import app.module.core.usecase.uri.ancestry.ports.URIAncestryPortIn; +import app.module.core.usecase.uri.currentmatch.ports.URICurrentMatchingPortIn; +import app.module.core.usecase.uri.currentmatch.ports.application.domain.URICurrentMatching; +import app.module.core.usecase.uri.toptier.ports.URITopTierPortIn; +import app.module.core.usecase.uri.toptier.ports.application.domain.URITopTier; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; +import org.springframework.web.servlet.ModelAndView; + +@Component +@RequiredArgsConstructor +@Slf4j +public class AdminURIInterceptor implements HandlerInterceptor { + + private final URICurrentMatchingPortIn uriCurrentMatchingPortIn; + private final URIAncestryPortIn uriAncestryPortIn; + private final URITopTierPortIn topTierPortIn; + + @Value("${app.aws.s3.domain:null}") + private String cloudFrontDomain; + + @Value("${app.aws.s3.bucketFolder:null}") + private String bucketFolder; + + @Override + public boolean preHandle(HttpServletRequest request, HttpServletResponse response, + Object handler) + throws Exception { + String requestURI = request.getRequestURI(); + + URICurrentMatching currentURI = uriCurrentMatchingPortIn.connect(AppType.ADMIN, requestURI); + if (currentURI == null) { + // spring boot 2.6.x 에서는 인터셉터에서 throw exception 이 동작안했기에 아래 코드가 필요했음. + // request.setAttribute("message", String.format("매핑되는 않은 URI - %s", requestURI)); + // request.setAttribute("exception", "NoMatchingURIException"); + // request.getRequestDispatcher("/error/interceptor").forward(request, response); + // return false; + + // spring boot 3.4.x 에서는 throw exception 이 가능! + throw new NoMatchingURIException(String.format("매핑되는 않은 URI - %s", requestURI)); + } + + request.setAttribute("currentURI", currentURI); + + return true; + } + + @Override + public void postHandle( + HttpServletRequest request, + HttpServletResponse response, + Object handler, + ModelAndView modelAndView) + throws Exception { + + if (modelAndView == null) { + log.info("POST_HANDLE_END::since modelAndView is null"); + return; + } + + if (!CommonUtil.isAjaxRequest(request)) { + URITopTier topTierOutput = topTierPortIn.connect(AppType.ADMIN); + modelAndView.addObject("topNode", recursiveMapping(topTierOutput)); + + if (modelAndView.getModelMap().getAttribute("currentURI") == null) { + modelAndView.addObject("currentURI", request.getAttribute("currentURI")); + } + + modelAndView.addObject( + "menuHierarchy", uriAncestryPortIn.connect(AppType.ADMIN, request.getRequestURI())); + + if (cloudFrontDomain != null && bucketFolder != null) { + modelAndView.addObject("S3URL", "https://" + cloudFrontDomain + bucketFolder); + } + } + } + + private URITopTierVO recursiveMapping(URITopTier output) { + return new URITopTierVO( + output.getId(), + output.getText(), + output.getUri(), + output.getShowOnNavi(), + CollectionUtils.emptyIfNull(output.getChildren()).stream() + .map(this::recursiveMapping) + .collect(Collectors.toList())); + } +} diff --git a/admin/src/main/java/app/module/admin/config/adapters/web/mvc/AdminWebMvcConfig.java b/admin/src/main/java/app/module/admin/config/adapters/web/mvc/AdminWebMvcConfig.java new file mode 100644 index 00000000..e4b379c8 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/adapters/web/mvc/AdminWebMvcConfig.java @@ -0,0 +1,82 @@ +package app.module.admin.config.adapters.web.mvc; + +import app.module.admin.config.adapters.web.interceptor.AdminURIInterceptor; +import app.module.core.config.adapters.web.interceptor.URIAuthorizeInterceptor; +import app.module.core.config.application.enums.PublicAccess; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.converter.HttpMessageConverter; +import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; +import org.springframework.web.servlet.LocaleResolver; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.i18n.CookieLocaleResolver; +import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; + +@Configuration +@RequiredArgsConstructor +public class AdminWebMvcConfig implements WebMvcConfigurer { + + private final AdminURIInterceptor adminURIInterceptor; + private final URIAuthorizeInterceptor uriAuthorizeInterceptor; + @Value("${path.upload.public}") + private String publicPath; + + @Override + public void addInterceptors(InterceptorRegistry registry) { + registry + .addInterceptor(adminURIInterceptor) + .addPathPatterns("/**") + .excludePathPatterns( + Arrays.stream(PublicAccess.values()) + .map(PublicAccess::getPath) + .collect(Collectors.toList())) + .excludePathPatterns("/api/**"); // api 는 menu 정보가 없기에 skip + + registry + .addInterceptor(uriAuthorizeInterceptor) + .addPathPatterns("/**") + .excludePathPatterns( + Arrays.stream(PublicAccess.values()) + .map(PublicAccess::getPath) + .collect(Collectors.toList())) + .excludePathPatterns("/api/**"); // api 는 menu 정보가 없기에 skip + + registry.addInterceptor(localeChangeInterceptor()); + } + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + registry + .addResourceHandler("/content-disposition/inline/**") + .addResourceLocations("file:///" + publicPath + "/") + .setCachePeriod(20); + } + + @Override + public void configureMessageConverters(List> converters) { + converters.add(new MappingJackson2HttpMessageConverter()); + } + + @Bean + public LocaleResolver localeResolver() { + CookieLocaleResolver slr = new CookieLocaleResolver(); + slr.setDefaultLocale(Locale.getDefault()); + slr.setCookieName("lang"); + return slr; + } + + @Bean + public LocaleChangeInterceptor localeChangeInterceptor() { + LocaleChangeInterceptor lci = new LocaleChangeInterceptor(); + lci.setParamName("lang"); + return lci; + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/aop/LoginFailAspect.java b/admin/src/main/java/app/module/admin/config/application/aop/LoginFailAspect.java new file mode 100644 index 00000000..202aa9bc --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/aop/LoginFailAspect.java @@ -0,0 +1,38 @@ +package app.module.admin.config.application.aop; + +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.enums.OperationLogType; +import app.module.core.config.application.util.CommonUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand; +import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn; +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.stereotype.Component; + +@Aspect +@Component +@RequiredArgsConstructor +public class LoginFailAspect { + + private final OperationLogSavePortIn operationLogSavePortIn; + private final MessageUtil messageUtil; + + @After("@annotation(app.module.admin.config.application.aop.LoginFailOperateLog)") + public void operate(JoinPoint joinPoint) throws Throwable { + Object[] args = joinPoint.getArgs(); + HttpServletRequest request = (HttpServletRequest) args[0]; + String targetId = request.getParameter("username"); + + operationLogSavePortIn.connect( + new OperationLogSaveCommand( + AppType.ADMIN, + OperationLogType.LOGIN_FAIL, + targetId, + CommonUtil.getClientIP(request), + messageUtil.getMessage("operate.login.fail", targetId))); + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/aop/LoginFailOperateLog.java b/admin/src/main/java/app/module/admin/config/application/aop/LoginFailOperateLog.java new file mode 100644 index 00000000..7ac6b23f --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/aop/LoginFailOperateLog.java @@ -0,0 +1,12 @@ +package app.module.admin.config.application.aop; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface LoginFailOperateLog { + +} diff --git a/admin/src/main/java/app/module/admin/config/application/aop/LoginSuccessAspect.java b/admin/src/main/java/app/module/admin/config/application/aop/LoginSuccessAspect.java new file mode 100644 index 00000000..fca4668c --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/aop/LoginSuccessAspect.java @@ -0,0 +1,42 @@ +package app.module.admin.config.application.aop; + +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.enums.OperationLogType; +import app.module.core.config.application.util.CommonUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand; +import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn; +import jakarta.servlet.http.HttpServletRequest; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.After; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Component; + +@Aspect +@Component +@Slf4j +@RequiredArgsConstructor +public class LoginSuccessAspect { + + private final OperationLogSavePortIn operationLogSavePortIn; + private final MessageUtil messageUtil; + + @After("@annotation(app.module.admin.config.application.aop.LoginSuccessOperateLog)") + public void operate(JoinPoint joinPoint) throws Throwable { + Object[] args = joinPoint.getArgs(); + + HttpServletRequest request = (HttpServletRequest) args[0]; + Authentication authentication = (Authentication) args[2]; + + operationLogSavePortIn.connect( + new OperationLogSaveCommand( + AppType.ADMIN, + OperationLogType.LOGIN_SUCCESS, + null, + CommonUtil.getClientIP(request), + messageUtil.getMessage("operate.login.success", authentication.getName()))); + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/aop/LoginSuccessOperateLog.java b/admin/src/main/java/app/module/admin/config/application/aop/LoginSuccessOperateLog.java new file mode 100644 index 00000000..c1682009 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/aop/LoginSuccessOperateLog.java @@ -0,0 +1,12 @@ +package app.module.admin.config.application.aop; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface LoginSuccessOperateLog { + +} diff --git a/admin/src/main/java/app/module/admin/config/application/aop/RoleUpdateAspect.java b/admin/src/main/java/app/module/admin/config/application/aop/RoleUpdateAspect.java new file mode 100644 index 00000000..83a8c518 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/aop/RoleUpdateAspect.java @@ -0,0 +1,88 @@ +package app.module.admin.config.application.aop; + +import app.module.core.config.adapters.web.security.domain.CoreRole; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.enums.OperationLogType; +import app.module.core.config.application.util.CommonUtil; +import app.module.core.usecase.admin.view.ports.AdminViewPortIn; +import app.module.core.usecase.admin.view.ports.application.domain.AdminView; +import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand; +import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn; +import jakarta.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.List; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.stereotype.Component; +import org.thymeleaf.util.StringUtils; + +@Aspect +@Component +@RequiredArgsConstructor +public class RoleUpdateAspect { + + private final AdminViewPortIn adminViewPortIn; + private final OperationLogSavePortIn operationLogSavePortIn; + + @Around( + "execution(* app.module.core.usecase.admin.saveAdmin.ports.application.SaveAdminService.connect(..))") + public Object operate(ProceedingJoinPoint joinPoint) throws Throwable { + Object[] args = joinPoint.getArgs(); + + String adminId = (String) args[0]; + List currentRoles = Collections.emptyList(); + + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + + for (int i = 0; i < method.getParameters().length; i++) { + String parameterName = method.getParameters()[i].getName(); + if (parameterName.equals("roleIds") && args[i] instanceof List) { + currentRoles = (List) args[i]; + } + } + + Optional beforeAdmin = adminViewPortIn.connect(adminId); + + // List currentRoles = + // adminId.getWithRoles().stream() + // .map(adminUserWithRole -> adminUserWithRole.getRole().getId()) + // .collect(Collectors.toList()); + + boolean createLog = false; + + if (beforeAdmin.isPresent()) { + List beforeRoles = + beforeAdmin.get().getRoles().stream().map(CoreRole::getId).toList(); + if (beforeRoles.size() != currentRoles.size() + || currentRoles.stream().anyMatch(item -> !beforeRoles.contains(item))) { + createLog = true; + } + } else if (currentRoles.size() > 0) { + createLog = true; + } + + if (createLog) { + String operatorId = Optional.ofNullable(CommonUtil.getLoginUsername()) + .orElse("init data"); + HttpServletRequest request = CommonUtil.getRequest(); + + operationLogSavePortIn.connect( + new OperationLogSaveCommand( + AppType.ADMIN, + OperationLogType.ROLE_UPDATE, + adminId, + request != null ? CommonUtil.getClientIP(request) : null, + String.format( + "`%s` grants [%s] permissions to `%s`", + operatorId, StringUtils.join(currentRoles, ", "), adminId))); + } + + return joinPoint.proceed(); + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/aop/RoleUpdateOperateLog.java b/admin/src/main/java/app/module/admin/config/application/aop/RoleUpdateOperateLog.java new file mode 100644 index 00000000..5214e877 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/aop/RoleUpdateOperateLog.java @@ -0,0 +1,12 @@ +package app.module.admin.config.application.aop; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface RoleUpdateOperateLog { + +} diff --git a/admin/src/main/java/app/module/admin/config/application/listener/SessionListener.java b/admin/src/main/java/app/module/admin/config/application/listener/SessionListener.java new file mode 100644 index 00000000..46728fa7 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/listener/SessionListener.java @@ -0,0 +1,22 @@ +package app.module.admin.config.application.listener; + +import jakarta.servlet.http.HttpSessionEvent; +import jakarta.servlet.http.HttpSessionListener; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Component; + +/** + * Spring Boot 을 이용하지만 내장 Tomcat 이 아닌 외부 WAS 를 이용하는 경우 HttpSessionListener 를 이용해 Session 유효기간을 지정해야 + * 한다. + */ +@Component +public class SessionListener implements HttpSessionListener { + + @Value("${app.admin.session.validity.period.seconds}") + Integer sessionValiditySeconds; + + @Override + public void sessionCreated(HttpSessionEvent se) { + se.getSession().setMaxInactiveInterval(sessionValiditySeconds); + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/security/AdminAuthFailEvent.java b/admin/src/main/java/app/module/admin/config/application/security/AdminAuthFailEvent.java new file mode 100644 index 00000000..3854cdd8 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/security/AdminAuthFailEvent.java @@ -0,0 +1,75 @@ +package app.module.admin.config.application.security; + +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.enums.OperationLogType; +import app.module.core.config.application.util.CommonUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.admin.status.ports.AdminUpdateAccountLockPortIn; +import app.module.core.usecase.admin.status.ports.AdminUpdateLoginFailPortIn; +import app.module.core.usecase.admin.view.ports.AdminViewPortIn; +import app.module.core.usecase.operationlog.save.application.domain.OperationLogSaveCommand; +import app.module.core.usecase.operationlog.save.application.port.in.OperationLogSavePortIn; +import jakarta.servlet.http.HttpServletRequest; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.event.EventListener; +import org.springframework.security.authentication.BadCredentialsException; +import org.springframework.security.authentication.event.AbstractAuthenticationFailureEvent; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +@Component +@RequiredArgsConstructor +@Slf4j +public class AdminAuthFailEvent { + + private final AdminViewPortIn adminViewPortIn; + private final AdminUpdateLoginFailPortIn updateLoginFailPortIn; + private final AdminUpdateAccountLockPortIn updateAccountLockPortIn; + private final OperationLogSavePortIn operationLogSavePortIn; + private final MessageUtil messageUtil; + @Value("${app.admin.auth.fail.permit}") + private int failPermit; + + @EventListener + public void handleAuthenticationFailureEvent(AbstractAuthenticationFailureEvent event) { + HttpServletRequest request = + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + + if (event.getException() instanceof BadCredentialsException) { + adminViewPortIn + .connect(request.getParameter("username")) + .filter(admin -> admin.getAccountLocked() == null || !admin.getAccountLocked()) + .ifPresent( + adminUserViewInfo -> { + String adminUserId = adminUserViewInfo.getId(); + int failCnt = + Optional.ofNullable(adminUserViewInfo.getLoginFailCnt()).orElse(0) + 1; + updateLoginFailPortIn.connect(adminUserId, failCnt); + + if (failCnt >= failPermit) { + // 계정 잠금 처리 + updateAccountLockPortIn.connect(adminUserId, true); + + // 계정 잠금 메세지 전달 + CommonUtil.addFlashAlertMessages( + request.getSession(), + messageUtil.getMessage("security.auth.fail.exceed", failPermit)); + + // 계정 잠금 로그 기록 + operationLogSavePortIn.connect( + new OperationLogSaveCommand( + AppType.ADMIN, + OperationLogType.ACCOUNT_LOCKED, + adminUserViewInfo.getId(), + CommonUtil.getClientIP(request), + messageUtil.getMessage( + "operate.account.locked", adminUserViewInfo.getId()))); + } + }); + } + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/security/AdminAuthSuccessEvent.java b/admin/src/main/java/app/module/admin/config/application/security/AdminAuthSuccessEvent.java new file mode 100644 index 00000000..69c25b91 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/security/AdminAuthSuccessEvent.java @@ -0,0 +1,112 @@ +package app.module.admin.config.application.security; + +import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortIn; +import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserIdSaveCmd; +import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; +import app.module.admin.usecase.loggedinuser.view.ports.LoggedInUserViewPortIn; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserIdCmd; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserView; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.util.CommonUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.admin.status.ports.AdminUpdateLoginFailPortIn; +import app.module.core.usecase.admin.view.ports.AdminViewPortIn; +import jakarta.servlet.http.HttpServletRequest; +import java.time.LocalDateTime; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.context.event.EventListener; +import org.springframework.security.authentication.event.AbstractAuthenticationFailureEvent; +import org.springframework.security.authentication.event.AuthenticationSuccessEvent; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +@Component +@RequiredArgsConstructor +@Slf4j +public class AdminAuthSuccessEvent { + + private final MessageUtil messageUtil; + private final AdminViewPortIn adminViewPortIn; + private final AdminUpdateLoginFailPortIn updateLoginFailPortIn; + private final LoggedInUserViewPortIn loggedInUserViewPortIn; + private final LoggedInUserSavePortIn loggedInUserSavePortIn; + @Value("${app.admin.password.validity.period.days}") + private long passwordValidPeriodDays; + @Value("${app.admin.password.change.notice.period.days}") + private long passwordChangeNoticeDays; + @Value("${app.admin.session.validity.period.seconds}") + private long sessionValidPeriodSeconds; + @Value("${app.admin.session.maximum.num}") + private Integer maxSessionNum; + + @EventListener + public void handleAuthenticationSuccessEvent(AuthenticationSuccessEvent event) { + Authentication authentication = event.getAuthentication(); + AdminUser adminUser = (AdminUser) authentication.getPrincipal(); + + HttpServletRequest request = + ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); + + // 로그인 실패 회수 초기화 + adminViewPortIn + .connect(authentication.getName()) + .ifPresent(admin -> updateLoginFailPortIn.connect(admin.getId(), 0)); + + // 패스워드 변경일 공지 + if (passwordValidPeriodDays != -1 + && adminUser.getRemainPasswordDays() <= passwordChangeNoticeDays) { + CommonUtil.addFlashAlertMessages( + request.getSession(), + messageUtil.getMessage( + "security.password.change.notify", adminUser.getRemainPasswordDays())); + } + + if (maxSessionNum == 1) { + // 동시 접속 (중복 로그인) 여부 판단 후 사용자에게 메세지 보이기 + if (isAlreadyLoggedInSomewhere(authentication.getName(), + CommonUtil.getClientIP(request))) { + CommonUtil.addFlashAlertMessages( + request.getSession(), messageUtil.getMessage("security.auth.duplicate.login")); + } + + // 로그인 활성화 기록 생성 + loggedInUserSavePortIn.connect( + LoggedInUserSaveCmd.builder() + .loggedInUserId( + LoggedInUserIdSaveCmd.builder() + .appType(AppType.ADMIN) + .id(authentication.getName()) + .build()) + .clientIP(CommonUtil.getClientIP(request)) + .lastLoggedInAt(LocalDateTime.now()) + .build()); + } + } + + @EventListener + public void handleAuthenticationFailureEvent(AbstractAuthenticationFailureEvent event) { + Exception e = event.getException(); + Authentication authentication = event.getAuthentication(); + log.warn("Unsuccessful authentication result: {}", authentication, e); + } + + /** + * 사용자 로그인 여부 확인 + */ + private boolean isAlreadyLoggedInSomewhere(String username, String currentIP) { + LoggedInUserView loggedInUser = + loggedInUserViewPortIn.connect(new LoggedInUserIdCmd(AppType.ADMIN, username)); + if (loggedInUser == null) { + return false; + } + + LocalDateTime lastLoggedInAt = loggedInUser.getLastLoggedInAt(); + + return lastLoggedInAt.plusSeconds(sessionValidPeriodSeconds).isAfter(LocalDateTime.now()) + && !currentIP.equals(loggedInUser.getClientIP()); + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/security/AdminDetailsService.java b/admin/src/main/java/app/module/admin/config/application/security/AdminDetailsService.java new file mode 100644 index 00000000..5d4d753b --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/security/AdminDetailsService.java @@ -0,0 +1,88 @@ +package app.module.admin.config.application.security; + +import app.module.core.config.adapters.web.security.domain.CorePrivilege; +import app.module.core.config.adapters.web.security.domain.CoreRole; +import app.module.core.usecase.admin.view.ports.AdminViewPortIn; +import app.module.core.usecase.admin.view.ports.application.domain.AdminView; +import org.springframework.transaction.annotation.Transactional; +import java.time.LocalDateTime; +import java.util.Collection; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.authority.SimpleGrantedAuthority; +import org.springframework.security.core.userdetails.UserDetails; +import org.springframework.security.core.userdetails.UserDetailsService; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class AdminDetailsService implements UserDetailsService { + + private final AdminViewPortIn adminViewPortIn; + + @Value("${app.admin.password.validity.period.days}") + private long passwordValidPeriodDays; + + @Override + @Transactional + public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException { + AdminView adminUser = + adminViewPortIn + .connect(username) + .orElseThrow(() -> new UsernameNotFoundException("Invalid username or password.")); + + boolean accountLocked = Optional.ofNullable(adminUser.getAccountLocked()).orElse(false); + boolean accountDisabled = Optional.ofNullable(adminUser.getAccountDisabled()).orElse(false); + + return new AdminUser( + adminUser.getId(), + adminUser.getPassword(), + !accountDisabled, + true, + isCredentialsNonExpired(adminUser.getPasswordUpdatedAt()), + !accountLocked, + getAuthorities(adminUser.getRoles()), + passwordValidPeriodDays - getDaysPassedFrom(adminUser.getPasswordUpdatedAt())); + } + + /** + * Authorities (Role + Privileges) 합성. Role 과 Privileges 는 1:N 매핑되지만, 이 메서드를 통해 동일한 depth 로 배열에 + * 담겨 반환된다. 즉, Privilege 는 또다른 종류의 Role 로 볼 수 있다. + * + * @param roles + * @return authorities + */ + private Collection getAuthorities(Collection roles) { + return Stream.concat(getRoles(roles), getPrivileges(roles)) + .map(SimpleGrantedAuthority::new) + .collect(Collectors.toList()); + } + + private Stream getRoles(Collection roles) { + return roles.stream().map(CoreRole::getId); + } + + private Stream getPrivileges(Collection roles) { + return roles.stream() + .flatMap(roleOutput -> roleOutput.getPrivileges().stream()) + .map(CorePrivilege::getId); + } + + // 패스워드 만료 여부체크. 이 기능이 필요하지 않다면 항상 true 를 반환하도록 변경하면 된다. + private boolean isCredentialsNonExpired(LocalDateTime passwordUpdatedAt) { + // return passwordValidPeriodDays == -1 + // || getDaysPassedFrom(passwordUpdatedAt) <= passwordValidPeriodDays; + return true; + } + + // 패스워드 만료일 정보를 반환. 이 기능이 필요하지 않다면 항상 0L 을 반환하도록 변경하면 된다. + private long getDaysPassedFrom(LocalDateTime passwordUpdatedAt) { + // return Duration.between(passwordUpdatedAt, LocalDateTime.now()).toDays(); + return 0L; + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/security/AdminMethodSecurityConfig.java b/admin/src/main/java/app/module/admin/config/application/security/AdminMethodSecurityConfig.java new file mode 100644 index 00000000..e4374f5a --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/security/AdminMethodSecurityConfig.java @@ -0,0 +1,11 @@ +package app.module.admin.config.application.security; + +import org.springframework.context.annotation.Configuration; +import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity; +import org.springframework.security.config.annotation.method.configuration.GlobalMethodSecurityConfiguration; + +@Configuration +@EnableGlobalMethodSecurity(jsr250Enabled = true) +public class AdminMethodSecurityConfig extends GlobalMethodSecurityConfiguration { + +} diff --git a/admin/src/main/java/app/module/admin/config/application/security/AdminSecurityConfig.java b/admin/src/main/java/app/module/admin/config/application/security/AdminSecurityConfig.java new file mode 100644 index 00000000..2ef63878 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/security/AdminSecurityConfig.java @@ -0,0 +1,109 @@ +package app.module.admin.config.application.security; + +import app.module.core.config.application.enums.PublicAccess; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; +import javax.sql.DataSource; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.web.servlet.ServletListenerRegistrationBean; +import org.springframework.context.ApplicationEventPublisher; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.security.authentication.AuthenticationEventPublisher; +import org.springframework.security.authentication.DefaultAuthenticationEventPublisher; +import org.springframework.security.authentication.dao.DaoAuthenticationProvider; +import org.springframework.security.config.annotation.web.builders.HttpSecurity; +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; +import org.springframework.security.core.session.SessionRegistry; +import org.springframework.security.core.session.SessionRegistryImpl; +import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; +import org.springframework.security.web.SecurityFilterChain; +import org.springframework.security.web.authentication.rememberme.JdbcTokenRepositoryImpl; +import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository; +import org.springframework.security.web.session.HttpSessionEventPublisher; +import org.springframework.security.web.util.matcher.AntPathRequestMatcher; + +@Configuration +@EnableWebSecurity +@RequiredArgsConstructor +public class AdminSecurityConfig { + + private final AdminDetailsService adminDetailsService; + private final DataSource dataSource; + private final BCryptPasswordEncoder passwordEncoder; + @Value("${app.admin.session.maximum.num}") + private Integer maxSessionNum; + + @Bean + public DaoAuthenticationProvider authenticationProvider() { + DaoAuthenticationProvider auth = new DaoAuthenticationProvider(); + auth.setUserDetailsService(adminDetailsService); + auth.setPasswordEncoder(passwordEncoder); + return auth; + } + + @Bean + public PersistentTokenRepository persistentTokenRepository() { + JdbcTokenRepositoryImpl jdbcTokenRepository = new JdbcTokenRepositoryImpl(); + jdbcTokenRepository.setDataSource(dataSource); + return jdbcTokenRepository; + } + + /** + * 중복 로그인 방지를 위해 선언 + */ + @Bean + public SessionRegistry sessionRegistry() { + return new SessionRegistryImpl(); + } + + /** + * 중복 로그인 방지를 위해 선언 + */ + @Bean + public ServletListenerRegistrationBean httpSessionEventPublisher() { + return new ServletListenerRegistrationBean(new HttpSessionEventPublisher()); + } + + /** + * 인증 성공/실패 이벤트 수신을 위해 선언 + */ + @Bean + public AuthenticationEventPublisher authenticationEventPublisher( + ApplicationEventPublisher applicationEventPublisher) { + return new DefaultAuthenticationEventPublisher(applicationEventPublisher); + } + + @Bean + public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { + List permitPaths = + Arrays.stream(PublicAccess.values()) + .map(PublicAccess::getPath) + .collect(Collectors.toList()); + + http.authorizeHttpRequests( + (auth) -> + auth.requestMatchers(permitPaths.toArray(String[]::new)) + .permitAll() + .anyRequest().hasAuthority("ADMIN_ACCESS")) + .formLogin(formLogin -> formLogin.loginPage("/login")) + .rememberMe( + remMe -> + remMe + .tokenValiditySeconds(1209600) + .userDetailsService(adminDetailsService) + .tokenRepository(persistentTokenRepository())) + .logout( + logout -> + logout + .invalidateHttpSession(true) + .clearAuthentication(true) + .logoutRequestMatcher(new AntPathRequestMatcher("/logout"))) + .sessionManagement( + session -> session.maximumSessions(maxSessionNum).maxSessionsPreventsLogin(false)); + + return http.build(); + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/security/AdminUser.java b/admin/src/main/java/app/module/admin/config/application/security/AdminUser.java new file mode 100644 index 00000000..d7d58d51 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/security/AdminUser.java @@ -0,0 +1,32 @@ +package app.module.admin.config.application.security; + +import java.util.Collection; +import lombok.Getter; +import org.springframework.security.core.GrantedAuthority; +import org.springframework.security.core.userdetails.User; + +@Getter +public class AdminUser extends User { + + private long remainPasswordDays; + + public AdminUser( + String username, + String password, + boolean enabled, + boolean accountNonExpired, + boolean credentialsNonExpired, + boolean accountNonLocked, + Collection authorities, + long remainPasswordDays) { + super( + username, + password, + enabled, + accountNonExpired, + credentialsNonExpired, + accountNonLocked, + authorities); + this.remainPasswordDays = remainPasswordDays; + } +} diff --git a/admin/src/main/java/app/module/admin/config/application/util/AdminUtil.java b/admin/src/main/java/app/module/admin/config/application/util/AdminUtil.java new file mode 100644 index 00000000..8116b710 --- /dev/null +++ b/admin/src/main/java/app/module/admin/config/application/util/AdminUtil.java @@ -0,0 +1,22 @@ +package app.module.admin.config.application.util; + +import app.module.core.config.adapters.web.interceptor.model.URITopTierVO; +import java.util.List; +import org.springframework.stereotype.Component; + +@Component +public class AdminUtil { + + public boolean shouldDisplaySubNodes(List uriList) { + boolean result = false; + if (uriList != null && !uriList.isEmpty()) { + for (URITopTierVO uri : uriList) { + if (uri.getShowOnNavi()) { + result = true; + break; + } + } + } + return result; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/AdminExcelController.java b/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/AdminExcelController.java new file mode 100644 index 00000000..8cdacf57 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/AdminExcelController.java @@ -0,0 +1,80 @@ +package app.module.admin.usecase.admin.getAdmins.adapters.web; + +import app.module.admin.usecase.admin.getAdmins.adapters.web.model.AdminListFilterVO; +import app.module.core.config.application.util.ExcelUtil; +import app.module.core.usecase.admin.getAdmins.ports.GetAdminsPortIn; +import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdmins; +import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdminsCmd; +import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdminsRole; +import jakarta.servlet.http.HttpServletResponse; +import java.time.format.DateTimeFormatter; +import java.util.Optional; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PageableDefault; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; + +@Controller +@RequiredArgsConstructor +class AdminExcelController { + + private final GetAdminsPortIn getAdminsPortIn; + private final ExcelUtil excelUtil; + + @PostMapping(path = "/settings/admins/excel") + void excelDownload( + HttpServletResponse response, + @PageableDefault(sort = "createdAt") Pageable pageable, + @ModelAttribute("paramDto") AdminListFilterVO adminListFilterVO) { + + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet("예제 관리자 목록"); + + Page listOutput = + getAdminsPortIn.connect( + pageable, + new GetAdminsCmd( + adminListFilterVO.getSearchField(), + adminListFilterVO.getSearchValue(), + adminListFilterVO.getSearchRole())); + + if (CollectionUtils.isNotEmpty(listOutput.getContent())) { + // Header + Row headerRow = sheet.createRow(sheet.getPhysicalNumberOfRows()); + excelUtil.createCells(headerRow, "번호", "이메일", "권한", "등록일", "최근 수정일"); + + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + + listOutput + .getContent() + .forEach( + item -> { + Row row = sheet.createRow(sheet.getPhysicalNumberOfRows()); + excelUtil.createCells( + row, + item.getId(), + item.getEmail(), + item.getRoles().stream() + .map(GetAdminsRole::getId) + .collect(Collectors.joining(", ")), + Optional.ofNullable(item.getCreatedAt()) + .map(localDateTime -> localDateTime.format(formatter)) + .orElse(""), + Optional.ofNullable(item.getUpdatedAt()) + .map(localDateTime -> localDateTime.format(formatter)) + .orElse("")); + }); + } + + excelUtil.generateWithPassword(response, wb, "admin-list"); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/AdminListController.java b/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/AdminListController.java new file mode 100644 index 00000000..f00d6a39 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/AdminListController.java @@ -0,0 +1,48 @@ +package app.module.admin.usecase.admin.getAdmins.adapters.web; + +import app.module.admin.usecase.admin.getAdmins.adapters.web.model.AdminListFilterVO; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.admin.getAdmins.ports.GetAdminsPortIn; +import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdmins; +import app.module.core.usecase.admin.getAdmins.ports.application.domain.GetAdminsCmd; +import app.module.core.usecase.role.list.ports.RoleListPortIn; +import app.module.core.usecase.role.list.ports.application.domain.RoleElement; +import app.module.core.usecase.uicode.list.ports.UICodeListPortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PageableDefault; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +class AdminListController { + + private final GetAdminsPortIn getAdminsPortIn; + private final RoleListPortIn roleListPortIn; + private final UICodeListPortIn uiCodeListPortIn; + + @GetMapping(path = "/settings/admins") + String operate( + Model model, + @PageableDefault(sort = "createdAt") Pageable pageable, + @ModelAttribute("listStatus") AdminListFilterVO adminListFilterVO) { + + Page listOutput = + getAdminsPortIn.connect( + pageable, + new GetAdminsCmd( + adminListFilterVO.getSearchField(), + adminListFilterVO.getSearchValue(), + adminListFilterVO.getSearchRole())); + + model.addAttribute("listOutput", listOutput); + model.addAttribute("roles", roleListPortIn.connect(AppType.ADMIN)); + model.addAttribute("pageRows", uiCodeListPortIn.connect("code.pageable.rows")); + + return "admin/adminList"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/model/AdminListFilterVO.java b/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/model/AdminListFilterVO.java new file mode 100644 index 00000000..49cff1d5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/getAdmins/adapters/web/model/AdminListFilterVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.admin.getAdmins.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class AdminListFilterVO { + + private String searchField; + private String searchValue; + private String searchRole; +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/AdminRemoveController.java b/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/AdminRemoveController.java new file mode 100644 index 00000000..444d049e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/AdminRemoveController.java @@ -0,0 +1,31 @@ +package app.module.admin.usecase.admin.removeAdmins.adapters.web; + +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.admin.removeAdmin.ports.RemoveAdminPortIn; +import java.util.List; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +@Controller +@RequiredArgsConstructor +class AdminRemoveController { + + private final MessageUtil messageUtil; + private final RemoveAdminPortIn removeAdminPortIn; + + @PostMapping(path = "/settings/admins/delete") + String operate(RedirectAttributes redirectAttributes, @RequestParam List checkedIds) { + + if (CollectionUtils.isNotEmpty(checkedIds)) { + removeAdminPortIn.connect(checkedIds); + redirectAttributes.addFlashAttribute( + "operationMessage", messageUtil.getMessage("operation.settings.admin.removed")); + } + + return "redirect:/settings/admins"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/RemoveAdminsController.java b/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/RemoveAdminsController.java new file mode 100644 index 00000000..6b095837 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/RemoveAdminsController.java @@ -0,0 +1,39 @@ +package app.module.admin.usecase.admin.removeAdmins.adapters.web; + +import app.module.admin.usecase.admin.removeAdmins.adapters.web.model.RemoveAdminsReqVO; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.admin.removeAdmin.ports.RemoveAdminPortIn; +import jakarta.validation.Valid; +import java.util.List; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +@RestController +@RequiredArgsConstructor +class RemoveAdminsController { + + private final RemoveAdminPortIn removeAdminPortIn; + + @DeleteMapping(path = "/api/settings/admin/remove") + ResponseEntity operate(@Valid RemoveAdminsReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + if (CollectionUtils.isNotEmpty(reqVO.getCheckedIds())) { + removeAdminPortIn.connect(reqVO.getCheckedIds()); + } + + return ResponseEntity.status(HttpStatus.OK).body(reqVO); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/model/RemoveAdminsReqVO.java b/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/model/RemoveAdminsReqVO.java new file mode 100644 index 00000000..bf9f564e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/removeAdmins/adapters/web/model/RemoveAdminsReqVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.admin.removeAdmins.adapters.web.model; + +import java.util.List; +import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class RemoveAdminsReqVO { + List checkedIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminCreateGetController.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminCreateGetController.java new file mode 100644 index 00000000..a1bdc921 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminCreateGetController.java @@ -0,0 +1,23 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web; + +import app.module.admin.usecase.admin.saveAdmin.adapters.web.model.AdminCreateBindingVO; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.role.list.ports.RoleListPortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +public class AdminCreateGetController { + + private final RoleListPortIn roleListPortIn; + + @GetMapping(path = "/settings/admins/create") + String operate(Model model, @ModelAttribute("bindingVO") AdminCreateBindingVO bindingVO) { + model.addAttribute("roles", roleListPortIn.connect(AppType.ADMIN)); + return "admin/adminCreateForm"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminCreatePostController.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminCreatePostController.java new file mode 100644 index 00000000..c7f2f417 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminCreatePostController.java @@ -0,0 +1,54 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web; + +import app.module.admin.usecase.admin.saveAdmin.adapters.web.model.AdminCreateBindingVO; +import app.module.admin.usecase.admin.saveAdmin.adapters.web.validator.AdminCreateValidator; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.admin.saveAdmin.ports.SaveAdminPortIn; +import app.module.core.usecase.role.list.ports.RoleListPortIn; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +@Controller +@RequiredArgsConstructor +public class AdminCreatePostController { + + private final RoleListPortIn roleListPortIn; + private final MessageUtil messageUtil; + private final SaveAdminPortIn savePortIn; + private final AdminCreateValidator adminCreateValidator; + + @PostMapping(path = "/settings/admins/create") + String operate( + RedirectAttributes redirectAttributes, + Model model, + @Valid @ModelAttribute("bindingVO") AdminCreateBindingVO bindingVO, + BindingResult bindingResult) { + + adminCreateValidator.validate(bindingVO, bindingResult); + if (bindingResult.hasErrors()) { + model.addAttribute("roles", roleListPortIn.connect(AppType.ADMIN)); + return "admin/adminCreateForm"; + } + + savePortIn.connect( + bindingVO.getId(), + bindingVO.getPassword(), + bindingVO.getEmail(), + bindingVO.getAccountDisabled(), + bindingVO.getAccountLocked(), + bindingVO.getRoleIds()); + + redirectAttributes.addFlashAttribute( + "operationMessage", + messageUtil.getMessage("operation.settings.admin.created", bindingVO.getId())); + + return "redirect:/settings/admins"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdateGetController.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdateGetController.java new file mode 100644 index 00000000..1496eb55 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdateGetController.java @@ -0,0 +1,65 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web; + +import app.module.admin.usecase.admin.getAdmins.adapters.web.model.AdminListFilterVO; +import app.module.admin.usecase.admin.saveAdmin.adapters.web.model.AdminUpdateBindingVO; +import app.module.core.config.adapters.web.security.domain.CoreRole; +import app.module.core.config.application.component.ListPageableInfo; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.admin.view.ports.AdminViewPortIn; +import app.module.core.usecase.admin.view.ports.application.domain.AdminView; +import app.module.core.usecase.role.list.ports.RoleListPortIn; +import java.util.NoSuchElementException; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; + +@Controller +@RequiredArgsConstructor +class AdminUpdateGetController { + + private final AdminViewPortIn adminViewPortIn; + private final RoleListPortIn roleListPortIn; + private final MessageUtil messageUtil; + + @GetMapping(path = "/settings/admins/update/{adminId}") + String operate( + Model model, + @PathVariable String adminId, + @ModelAttribute("pageable") final ListPageableInfo pageable, + @ModelAttribute("listStatus") AdminListFilterVO listStatus) { + + AdminView output = + adminViewPortIn + .connect(adminId) + .orElseThrow( + () -> + new NoSuchElementException( + messageUtil.getMessage("exception.noSuchElement", adminId, + "Admin ID"))); + + AdminUpdateBindingVO bindingVO = + new AdminUpdateBindingVO( + output.getCreatedBy(), + output.getCreatedAt(), + output.getUpdatedBy(), + output.getUpdatedAt(), + output.getId(), + null, + output.getEmail(), + output.getPasswordUpdatedAt(), + output.getAccountDisabled(), + output.getLoginFailCnt(), + output.getAccountLocked(), + output.getRoles().stream().map(CoreRole::getId).collect(Collectors.toList())); + + model.addAttribute("bindingVO", bindingVO); + model.addAttribute("roles", roleListPortIn.connect(AppType.ADMIN)); + + return "admin/adminUpdateForm"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdatePostController.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdatePostController.java new file mode 100644 index 00000000..8f217081 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/AdminUpdatePostController.java @@ -0,0 +1,54 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web; + +import app.module.admin.usecase.admin.saveAdmin.adapters.web.model.AdminUpdateBindingVO; +import app.module.admin.usecase.admin.saveAdmin.adapters.web.validator.AdminUpdateValidator; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.admin.saveAdmin.ports.SaveAdminPortIn; +import app.module.core.usecase.role.list.ports.RoleListPortIn; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +@Controller +@RequiredArgsConstructor +class AdminUpdatePostController { + + private final AdminUpdateValidator adminUpdateValidator; + private final RoleListPortIn roleListPortIn; + private final SaveAdminPortIn saveAdminPortIn; + private final MessageUtil messageUtil; + + @PostMapping(path = "/settings/admins/update/{id}") + String operate( + Model model, + RedirectAttributes redirectAttributes, + @Valid @ModelAttribute("bindingVO") AdminUpdateBindingVO bindingVO, + BindingResult bindingResult) { + + adminUpdateValidator.validate(bindingVO, bindingResult); + if (bindingResult.hasErrors()) { + model.addAttribute("roles", roleListPortIn.connect(AppType.ADMIN)); + return "admin/adminUpdateForm"; + } + + saveAdminPortIn.connect( + bindingVO.getId(), + bindingVO.getUpdatePassword(), + bindingVO.getEmail(), + bindingVO.getAccountDisabled(), + bindingVO.getAccountLocked(), + bindingVO.getRoleIds()); + + redirectAttributes.addFlashAttribute( + "operationMessage", + messageUtil.getMessage("operation.settings.admin.updated", bindingVO.getId())); + + return "redirect:/settings/admins"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/model/AdminCreateBindingVO.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/model/AdminCreateBindingVO.java new file mode 100644 index 00000000..89455fbe --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/model/AdminCreateBindingVO.java @@ -0,0 +1,28 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web.model; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class AdminCreateBindingVO { + + private String id; + private String password; + + @NotBlank(message = "{valid.common.required}") + @Pattern( + regexp = + "^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", + message = "{valid.common.email.wrong}") + private String email; + + private Boolean accountDisabled; + private Boolean accountLocked; + private List roleIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/model/AdminUpdateBindingVO.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/model/AdminUpdateBindingVO.java new file mode 100644 index 00000000..07f5a020 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/model/AdminUpdateBindingVO.java @@ -0,0 +1,40 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web.model; + +import app.module.core.config.application.component.AuditOutput; +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; +import java.time.LocalDateTime; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class AdminUpdateBindingVO implements AuditOutput { + + private final String createdBy; + + private final LocalDateTime createdAt; + + private final String updatedBy; + + private final LocalDateTime updatedAt; + + private String id; + private String updatePassword; + + @NotBlank(message = "{valid.common.required}") + @Pattern( + regexp = + "^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", + message = "{valid.common.email.wrong}") + private String email; + + private LocalDateTime passwordUpdatedAt; + private Boolean accountDisabled; + private Integer loginFailCnt; + private Boolean accountLocked; + private List roleIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminCreateValidator.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminCreateValidator.java new file mode 100644 index 00000000..895fe727 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminCreateValidator.java @@ -0,0 +1,37 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web.validator; + +import app.module.admin.usecase.admin.saveAdmin.adapters.web.model.AdminCreateBindingVO; +import java.util.Optional; +import org.springframework.stereotype.Component; +import org.springframework.validation.Errors; +import org.springframework.validation.ValidationUtils; +import org.springframework.validation.Validator; + +@Component +public class AdminCreateValidator implements Validator { + + private final String PASSWORD_REGEX = "^((?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%_\\-])\\S{6,15})$"; + + @Override + public boolean supports(Class clazz) { + return AdminCreateBindingVO.class.equals(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + AdminCreateBindingVO vo = (AdminCreateBindingVO) target; + + ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "valid.common.required"); + + Optional.ofNullable(vo.getPassword()) + .filter(password -> !password.matches(PASSWORD_REGEX)) + .ifPresent(password -> errors.rejectValue("password", "valid.common.password.wrong")); + + Optional.ofNullable(vo.getRoleIds()) + .filter(ids -> ids.size() < 1) + .ifPresent( + ids -> + errors.rejectValue( + "roleIds", "valid.common.required.size.min", new Object[]{1}, "")); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java new file mode 100644 index 00000000..75fb5e2f --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/admin/saveAdmin/adapters/web/validator/AdminUpdateValidator.java @@ -0,0 +1,34 @@ +package app.module.admin.usecase.admin.saveAdmin.adapters.web.validator; + +import app.module.admin.usecase.admin.saveAdmin.adapters.web.model.AdminUpdateBindingVO; +import java.util.Optional; +import org.springframework.stereotype.Component; +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; + +@Component +public class AdminUpdateValidator implements Validator { + + private final String PASSWORD_REGEX = "^((?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%_\\-])\\S{6,15})$"; + + @Override + public boolean supports(Class clazz) { + return AdminUpdateBindingVO.class.equals(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + AdminUpdateBindingVO vo = (AdminUpdateBindingVO) target; + + Optional.ofNullable(vo.getRoleIds()) + .filter(ids -> ids.size() < 1) + .ifPresent( + ids -> + errors.rejectValue( + "roleIds", "valid.common.required.size.min", new Object[]{1}, "")); + + Optional.ofNullable(vo.getUpdatePassword()) + .filter(s -> !s.trim().isEmpty() && !s.matches(PASSWORD_REGEX)) + .ifPresent(s -> errors.rejectValue("updatePassword", "valid.common.password.wrong")); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/CreateArticleController.java b/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/CreateArticleController.java new file mode 100644 index 00000000..f0575b2e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/CreateArticleController.java @@ -0,0 +1,47 @@ +package app.module.admin.usecase.article.createArticle.adapters.web; + +import app.module.admin.usecase.article.createArticle.adapters.web.model.CreateArticleReqVO; +import app.module.admin.usecase.article.createArticle.adapters.web.validator.CreateArticleValidator; +import app.module.core.usecase.article.createArticle.ports.CreateArticlePortIn; +import app.module.core.usecase.article.createArticle.ports.application.domain.CreateArticle; +import app.module.core.usecase.article.createArticle.ports.application.domain.CreateArticleCmd; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class CreateArticleController { + + private final CreateArticlePortIn createArticlePortIn; + private final CreateArticleValidator createArticleValidator; + + @PostMapping(path = "/api/board/articles/create") + ResponseEntity operate(@Valid CreateArticleReqVO reqVO, BindingResult bindingResult) { + + createArticleValidator.validate(reqVO, bindingResult); + + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + CreateArticle article = + createArticlePortIn + .operate( + new CreateArticleCmd( + reqVO.getTitle(), + reqVO.getContent(), + reqVO.getVisible(), + reqVO.getStartDate(), + reqVO.getEndDate(), + reqVO.getFileMappingId())) + .orElseThrow(); + + return ResponseEntity.status(HttpStatus.OK).body(article); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/model/CreateArticleReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/model/CreateArticleReqVO.java new file mode 100644 index 00000000..5be2dd61 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/model/CreateArticleReqVO.java @@ -0,0 +1,43 @@ +package app.module.admin.usecase.article.createArticle.adapters.web.model; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.text.StringEscapeUtils; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class CreateArticleReqVO { + + @NotBlank(message = "{valid.common.required}") + private String title; + + @NotBlank(message = "{valid.common.required}") + private String content; + + @NotNull(message = "{valid.common.required}") + private Boolean visible; + + @NotNull(message = "{valid.common.required}") + private LocalDateTime startDate; + + @NotNull(message = "{valid.common.required}") + private LocalDateTime endDate; + + private List fileMappingId; + + public String getTitle() { + return StringEscapeUtils.escapeHtml4(title); + } + + public String getContent() { + return StringEscapeUtils.escapeHtml4(content); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/validator/CreateArticleValidator.java b/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/validator/CreateArticleValidator.java new file mode 100644 index 00000000..cf8dec7b --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/createArticle/adapters/web/validator/CreateArticleValidator.java @@ -0,0 +1,55 @@ +package app.module.admin.usecase.article.createArticle.adapters.web.validator; + +import app.module.admin.usecase.article.createArticle.adapters.web.model.CreateArticleReqVO; +import app.module.core.config.application.util.MessageUtil; +import java.time.LocalDateTime; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; + +@Component +@RequiredArgsConstructor +public class CreateArticleValidator implements Validator { + + private final MessageUtil messageUtil; + + @Override + public boolean supports(Class clazz) { + return CreateArticleReqVO.class.equals(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + CreateArticleReqVO vo = (CreateArticleReqVO) target; + + LocalDateTime startDate = vo.getStartDate(); + LocalDateTime endDate = vo.getEndDate(); + + // 게시일 날짜 체크 + if (startDate == null) { + errors.rejectValue( + "startDate", "valid.common.required", + messageUtil.getMessage("valid.common.required")); + } + + if (endDate == null) { + errors.rejectValue( + "endDate", "valid.common.required", + messageUtil.getMessage("valid.common.required")); + } + + if (startDate != null && endDate != null) { + if (!startDate.isBefore(endDate)) { + errors.rejectValue( + "startDate", + "valid.common.date.invalid", + messageUtil.getMessage("valid.common.date.invalid")); + errors.rejectValue( + "endDate", + "valid.common.date.invalid", + messageUtil.getMessage("valid.common.date.invalid")); + } + } + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticle/adapters/web/GetArticleController.java b/admin/src/main/java/app/module/admin/usecase/article/getArticle/adapters/web/GetArticleController.java new file mode 100644 index 00000000..bee33177 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticle/adapters/web/GetArticleController.java @@ -0,0 +1,23 @@ +package app.module.admin.usecase.article.getArticle.adapters.web; + +import app.module.core.usecase.article.getArticle.ports.GetArticlePortIn; +import app.module.core.usecase.article.getArticle.ports.application.domain.GetArticleCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetArticleController { + + private final GetArticlePortIn getArticlePortIn; + + @GetMapping(path = "/api/board/articles/{id}") + ResponseEntity operate(@PathVariable Long id) { + return ResponseEntity.status(HttpStatus.OK) + .body(getArticlePortIn.operate(new GetArticleCmd(id)).orElseThrow()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticleCreateUI/adapters/web/CreateArticleUIController.java b/admin/src/main/java/app/module/admin/usecase/article/getArticleCreateUI/adapters/web/CreateArticleUIController.java new file mode 100644 index 00000000..3c764cae --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticleCreateUI/adapters/web/CreateArticleUIController.java @@ -0,0 +1,21 @@ +package app.module.admin.usecase.article.getArticleCreateUI.adapters.web; + +import app.module.admin.usecase.article.getArticleCreateUI.adapters.web.model.CreateArticleUIReqVO; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +class CreateArticleUIController { + + @GetMapping(path = "/board/articles/create") + String operate( + Model model, + @ModelAttribute("reqVO") CreateArticleUIReqVO reqVO) { + + return "board/articles/create"; + } +} \ No newline at end of file diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticleCreateUI/adapters/web/model/CreateArticleUIReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/getArticleCreateUI/adapters/web/model/CreateArticleUIReqVO.java new file mode 100644 index 00000000..ea6f28de --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticleCreateUI/adapters/web/model/CreateArticleUIReqVO.java @@ -0,0 +1,14 @@ +package app.module.admin.usecase.article.getArticleCreateUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class CreateArticleUIReqVO { + +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticleUpdateUI/adapters/web/GetArticleUpdateUIController.java b/admin/src/main/java/app/module/admin/usecase/article/getArticleUpdateUI/adapters/web/GetArticleUpdateUIController.java new file mode 100644 index 00000000..fa6f2eb0 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticleUpdateUI/adapters/web/GetArticleUpdateUIController.java @@ -0,0 +1,23 @@ +package app.module.admin.usecase.article.getArticleUpdateUI.adapters.web; + +import app.module.admin.usecase.article.getArticleUpdateUI.adapters.web.model.GetArticleUpdateUIReqVO; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; + +@Controller +@RequiredArgsConstructor +class GetArticleUpdateUIController { + + @GetMapping(path = "/board/articles/{id}") + String operate( + Model model, + @PathVariable @ModelAttribute("id") Long id, + @ModelAttribute("reqVO") GetArticleUpdateUIReqVO reqVO) { + + return "board/articles/{id}"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticleUpdateUI/adapters/web/model/GetArticleUpdateUIReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/getArticleUpdateUI/adapters/web/model/GetArticleUpdateUIReqVO.java new file mode 100644 index 00000000..64f4d606 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticleUpdateUI/adapters/web/model/GetArticleUpdateUIReqVO.java @@ -0,0 +1,14 @@ +package app.module.admin.usecase.article.getArticleUpdateUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetArticleUpdateUIReqVO { + +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticles/adapters/web/GetArticlesController.java b/admin/src/main/java/app/module/admin/usecase/article/getArticles/adapters/web/GetArticlesController.java new file mode 100644 index 00000000..6f248a9a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticles/adapters/web/GetArticlesController.java @@ -0,0 +1,32 @@ +package app.module.admin.usecase.article.getArticles.adapters.web; + +import app.module.admin.usecase.article.getArticles.adapters.web.model.GetArticlesReqVO; +import app.module.core.usecase.article.getArticles.ports.GetArticlesPortIn; +import app.module.core.usecase.article.getArticles.ports.application.domain.GetArticles; +import app.module.core.usecase.article.getArticles.ports.application.domain.GetArticlesCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetArticlesController { + + private final GetArticlesPortIn getArticlesPortIn; + + @GetMapping(path = "/api/board/articles") + ResponseEntity operate(@PageableDefault Pageable pageable, GetArticlesReqVO reqVO) { + Page articles = + getArticlesPortIn.operate( + pageable, + new GetArticlesCmd( + reqVO.getSearchField(), reqVO.getSearchValue(), reqVO.getSearchOpen())); + + return ResponseEntity.status(HttpStatus.OK).body(articles); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticles/adapters/web/model/GetArticlesReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/getArticles/adapters/web/model/GetArticlesReqVO.java new file mode 100644 index 00000000..9ab23826 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticles/adapters/web/model/GetArticlesReqVO.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.article.getArticles.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetArticlesReqVO { + + private String searchField; + private String searchValue; + private String searchOpen; +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticlesExcel/adapters/web/GetArticlesExcelController.java b/admin/src/main/java/app/module/admin/usecase/article/getArticlesExcel/adapters/web/GetArticlesExcelController.java new file mode 100644 index 00000000..482ab25d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticlesExcel/adapters/web/GetArticlesExcelController.java @@ -0,0 +1,210 @@ +package app.module.admin.usecase.article.getArticlesExcel.adapters.web; + +import app.module.admin.usecase.article.getArticlesExcel.adapters.web.model.GetArticlesExcelReqVO; +import app.module.core.usecase.article.getArticles.ports.GetArticlesPortIn; +import app.module.core.usecase.article.getArticles.ports.application.domain.GetArticles; +import app.module.core.usecase.article.getArticles.ports.application.domain.GetArticlesCmd; +import app.module.core.usecase.excel.createCell.ports.CreateCellPortIn; +import app.module.core.usecase.excel.createCell.ports.application.model.CellConfig; +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.time.format.DateTimeFormatter; +import java.util.Calendar; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import lombok.RequiredArgsConstructor; +import org.apache.poi.ss.usermodel.CellType; +import org.apache.poi.ss.usermodel.HorizontalAlignment; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.xssf.streaming.SXSSFSheet; +import org.apache.poi.xssf.streaming.SXSSFWorkbook; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.HttpHeaders; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetArticlesExcelController { + + private final GetArticlesPortIn getArticlesPortIn; + private final CreateCellPortIn createCellPortIn; + + @GetMapping(path = "/api/board/articles/excel") + void operate( + @PageableDefault(size = Integer.MAX_VALUE) Pageable pageable, + GetArticlesExcelReqVO reqVO, + HttpServletResponse response) + throws IOException { + + String title = "예제 게시판 목록"; + + Page output = + getArticlesPortIn.operate( + pageable, + new GetArticlesCmd( + reqVO.getSearchField(), reqVO.getSearchValue(), reqVO.getSearchOpen())); + + if (!output.getContent().isEmpty()) { + + // 1000 개 로우가 넘으면 디스크에 기록한다. + try (SXSSFWorkbook wb = new SXSSFWorkbook(1000)) { + SXSSFSheet sheet = wb.createSheet(title); + sheet.trackAllColumnsForAutoSizing(); + + AtomicInteger colNo = new AtomicInteger(0); + + // 상단 Header 생성 및 필터 적용 + createCellPortIn.operate( + // 상단 Header 의 Row 목록 - 2개 이상이면 병합이 가능해진다. + List.of(sheet.createRow(sheet.getPhysicalNumberOfRows())), + // 상단 Header Row 를 구성하는 col 목록 + List.of( + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + "제목", + createCellPortIn.getDefaultHeaderStyle(wb, HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + "공개여부", + createCellPortIn.getDefaultHeaderStyle(wb, HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + "게시일", + createCellPortIn.getDefaultHeaderStyle(wb, HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + "종료일", + createCellPortIn.getDefaultHeaderStyle(wb, HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + "최근 수정자", + createCellPortIn.getDefaultHeaderStyle(wb, HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + "최근 수정일", + createCellPortIn.getDefaultHeaderStyle(wb, HorizontalAlignment.CENTER), + null))); + sheet.setAutoFilter(new CellRangeAddress(0, 0, 0, colNo.get() - 1)); + + // 본문 데이터 + output + .getContent() + .forEach( + item -> { + colNo.set(0); + createCellPortIn.operate( + List.of(sheet.createRow(sheet.getPhysicalNumberOfRows())), + List.of( + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + item.getTitle(), + createCellPortIn.getDefaultDataStyle(wb, + HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + item.getVisible() ? "Y" : "N", + createCellPortIn.getDefaultDataStyle(wb, + HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + item.getStartDate() + .format( + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + createCellPortIn.getDefaultDataStyle(wb, + HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + item.getEndDate() + .format( + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + createCellPortIn.getDefaultDataStyle(wb, + HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + item.getUpdatedBy(), + createCellPortIn.getDefaultDataStyle(wb, + HorizontalAlignment.CENTER), + null), + new CellConfig( + 0, + colNo.getAndIncrement(), + null, + CellType.STRING, + item.getUpdatedAt() + .format( + DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")), + createCellPortIn.getDefaultDataStyle(wb, + HorizontalAlignment.CENTER), + null))); + }); + + // 한글 파일명 처리를 위해 URLEncoder 필요 + String filename = + URLEncoder.encode( + String.format( + "%s-%s.xlsx", + title, + new SimpleDateFormat("yyyyMMdd").format( + Calendar.getInstance().getTime())), + StandardCharsets.UTF_8); + + response.setHeader( + HttpHeaders.CONTENT_DISPOSITION, + String.format("attachment; filename=\"%s\"", filename)); + + wb.write(response.getOutputStream()); + + // 디스크에 기록한 임시 파일 제거 + wb.dispose(); + } + } + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticlesExcel/adapters/web/model/GetArticlesExcelReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/getArticlesExcel/adapters/web/model/GetArticlesExcelReqVO.java new file mode 100644 index 00000000..074ae351 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticlesExcel/adapters/web/model/GetArticlesExcelReqVO.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.article.getArticlesExcel.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetArticlesExcelReqVO { + + private String searchField; + private String searchValue; + private String searchOpen; +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticlesUI/adapters/web/GetArticlesUIController.java b/admin/src/main/java/app/module/admin/usecase/article/getArticlesUI/adapters/web/GetArticlesUIController.java new file mode 100644 index 00000000..0d0fc10a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticlesUI/adapters/web/GetArticlesUIController.java @@ -0,0 +1,24 @@ +package app.module.admin.usecase.article.getArticlesUI.adapters.web; + +import app.module.admin.usecase.article.getArticlesUI.adapters.web.model.GetArticlesUIReqVO; +import app.module.core.usecase.uicode.list.ports.UICodeListPortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +class GetArticlesUIController { + + private final UICodeListPortIn uiCodeListPortIn; + + @GetMapping(path = "/board/articles") + String operate(@ModelAttribute("reqVO") GetArticlesUIReqVO reqVO, Model model) { + + model.addAttribute("pageRows", uiCodeListPortIn.connect("code.pageable.rows")); + + return "board/articles"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/getArticlesUI/adapters/web/model/GetArticlesUIReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/getArticlesUI/adapters/web/model/GetArticlesUIReqVO.java new file mode 100644 index 00000000..37ac906c --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/getArticlesUI/adapters/web/model/GetArticlesUIReqVO.java @@ -0,0 +1,36 @@ +package app.module.admin.usecase.article.getArticlesUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import org.thymeleaf.util.StringUtils; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetArticlesUIReqVO { + + private Integer page; + private String sort; + private Integer size; + private String searchField; + private String searchValue; + private String searchOpen; + + public Integer getPage() { + // 요청 페이지 넘버 - 초기값 `0` + return page != null ? page : 0; + } + + public String getSort() { + // 정렬 값 - 초기값 `orderNo 내림차순` + return StringUtils.isEmpty(sort) ? "orderNo,DESC" : sort; + } + + public Integer getSize() { + // 페이지 당 아이템 수 - 초기값 `10` + return size != null ? size : 10; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/removeArticles/adapters/web/RemoveArticlesController.java b/admin/src/main/java/app/module/admin/usecase/article/removeArticles/adapters/web/RemoveArticlesController.java new file mode 100644 index 00000000..e636a408 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/removeArticles/adapters/web/RemoveArticlesController.java @@ -0,0 +1,31 @@ +package app.module.admin.usecase.article.removeArticles.adapters.web; + +import app.module.admin.usecase.article.removeArticles.adapters.web.model.RemoveArticlesReqVO; +import app.module.core.usecase.article.removeArticles.ports.RemoveArticlesPortIn; +import app.module.core.usecase.article.removeArticles.ports.application.domain.RemoveArticlesCmd; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RemoveArticlesController { + + private final RemoveArticlesPortIn removeArticlesPortIn; + + @DeleteMapping(path = "/api/board/articles/remove") + ResponseEntity operate(@Valid RemoveArticlesReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + removeArticlesPortIn.operate(new RemoveArticlesCmd(reqVO.getSelectIds())); + + return ResponseEntity.status(HttpStatus.OK).body(reqVO); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/removeArticles/adapters/web/model/RemoveArticlesReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/removeArticles/adapters/web/model/RemoveArticlesReqVO.java new file mode 100644 index 00000000..340f96ad --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/removeArticles/adapters/web/model/RemoveArticlesReqVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.article.removeArticles.adapters.web.model; + +import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class RemoveArticlesReqVO { + + private Set selectIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/sortArticles/adapters/web/SortArticlesController.java b/admin/src/main/java/app/module/admin/usecase/article/sortArticles/adapters/web/SortArticlesController.java new file mode 100644 index 00000000..4b593002 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/sortArticles/adapters/web/SortArticlesController.java @@ -0,0 +1,40 @@ +package app.module.admin.usecase.article.sortArticles.adapters.web; + +import app.module.admin.usecase.article.sortArticles.adapters.web.model.SortArticlesReqVO; +import app.module.core.usecase.article.sortArticles.ports.SortArticlesPortIn; +import app.module.core.usecase.article.sortArticles.ports.application.domain.SortArticlesCmd; +import jakarta.validation.Valid; +import java.util.List; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class SortArticlesController { + + private final SortArticlesPortIn sortArticlesPortIn; + + @PatchMapping(path = "/api/board/articles/sort") + ResponseEntity operate( + @Valid @RequestBody List reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY).body(bindingResult); + } + + sortArticlesPortIn.operate( + reqVO.stream() + .map( + sortArticlesReqVO -> + new SortArticlesCmd(sortArticlesReqVO.getId(), + sortArticlesReqVO.getOrderNo())) + .collect(Collectors.toList())); + + return ResponseEntity.status(HttpStatus.OK).body(reqVO); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/sortArticles/adapters/web/model/SortArticlesReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/sortArticles/adapters/web/model/SortArticlesReqVO.java new file mode 100644 index 00000000..2fed3cf0 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/sortArticles/adapters/web/model/SortArticlesReqVO.java @@ -0,0 +1,22 @@ +package app.module.admin.usecase.article.sortArticles.adapters.web.model; + +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class SortArticlesReqVO { + + @NotNull(message = "{valid.common.required}") + private Long id; + + @NotNull(message = "{valid.common.required}") + private Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/UpdateArticleController.java b/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/UpdateArticleController.java new file mode 100644 index 00000000..181697b3 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/UpdateArticleController.java @@ -0,0 +1,45 @@ +package app.module.admin.usecase.article.updateArticle.adapters.web; + +import app.module.admin.usecase.article.updateArticle.adapters.web.model.UpdateArticleReqVO; +import app.module.admin.usecase.article.updateArticle.adapters.web.validator.UpdateArticleValidator; +import app.module.core.usecase.article.updateArticle.ports.UpdateArticlePortIn; +import app.module.core.usecase.article.updateArticle.ports.application.domain.UpdateArticleCmd; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class UpdateArticleController { + + private final UpdateArticlePortIn updateArticlePortIn; + private final UpdateArticleValidator updateArticleValidator; + + @PutMapping(path = "/api/board/articles/update") + ResponseEntity operate(@Valid UpdateArticleReqVO reqVO, BindingResult bindingResult) { + + updateArticleValidator.validate(reqVO, bindingResult); + + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + updateArticlePortIn.operate( + new UpdateArticleCmd( + reqVO.getId(), + reqVO.getTitle(), + reqVO.getContent(), + reqVO.getVisible(), + reqVO.getOrderNo(), + reqVO.getStartDate(), + reqVO.getEndDate(), + reqVO.getFileMappingId())); + + return ResponseEntity.status(HttpStatus.OK).body(reqVO); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/model/UpdateArticleReqVO.java b/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/model/UpdateArticleReqVO.java new file mode 100644 index 00000000..593298bf --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/model/UpdateArticleReqVO.java @@ -0,0 +1,51 @@ +package app.module.admin.usecase.article.updateArticle.adapters.web.model; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotNull; +import java.time.LocalDateTime; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.apache.commons.text.StringEscapeUtils; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class UpdateArticleReqVO { + + @NotNull(message = "{valid.common.required}") + private Long id; + + @NotBlank(message = "{valid.common.required}") + private String title; + + @NotBlank(message = "{valid.common.required}") + private String content; + + @NotNull(message = "{valid.common.required}") + private Boolean visible; + + @NotNull(message = "{valid.common.required}") + private Integer orderNo; + + @NotNull(message = "{valid.common.required}") + private LocalDateTime startDate; + + @NotNull(message = "{valid.common.required}") + private LocalDateTime endDate; + + private List fileMappingId; + + public String getTitle() { + return StringEscapeUtils.escapeHtml4(title); + } + + public String getContent() { + return StringEscapeUtils.escapeHtml4(content); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/validator/UpdateArticleValidator.java b/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/validator/UpdateArticleValidator.java new file mode 100644 index 00000000..d9ad63ec --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/article/updateArticle/adapters/web/validator/UpdateArticleValidator.java @@ -0,0 +1,55 @@ +package app.module.admin.usecase.article.updateArticle.adapters.web.validator; + +import app.module.admin.usecase.article.updateArticle.adapters.web.model.UpdateArticleReqVO; +import app.module.core.config.application.util.MessageUtil; +import java.time.LocalDateTime; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Component; +import org.springframework.validation.Errors; +import org.springframework.validation.Validator; + +@Component +@RequiredArgsConstructor +public class UpdateArticleValidator implements Validator { + + private final MessageUtil messageUtil; + + @Override + public boolean supports(Class clazz) { + return UpdateArticleReqVO.class.equals(clazz); + } + + @Override + public void validate(Object target, Errors errors) { + UpdateArticleReqVO vo = (UpdateArticleReqVO) target; + + LocalDateTime startDate = vo.getStartDate(); + LocalDateTime endDate = vo.getEndDate(); + + // 게시일 날짜 체크 + if (startDate == null) { + errors.rejectValue( + "startDate", "valid.common.required", + messageUtil.getMessage("valid.common.required")); + } + + if (endDate == null) { + errors.rejectValue( + "endDate", "valid.common.required", + messageUtil.getMessage("valid.common.required")); + } + + if (startDate != null && endDate != null) { + if (!startDate.isBefore(endDate)) { + errors.rejectValue( + "startDate", + "valid.common.date.invalid", + messageUtil.getMessage("valid.common.date.invalid")); + errors.rejectValue( + "endDate", + "valid.common.date.invalid", + messageUtil.getMessage("valid.common.date.invalid")); + } + } + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/editor/adapters/web/EditorImageUploadController.java b/admin/src/main/java/app/module/admin/usecase/editor/adapters/web/EditorImageUploadController.java new file mode 100644 index 00000000..0f255841 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/editor/adapters/web/EditorImageUploadController.java @@ -0,0 +1,34 @@ +package app.module.admin.usecase.editor.adapters.web; + +import app.module.core.config.application.enums.FileUploadType; +import app.module.core.usecase.file.saveToStorage.ports.SaveToStoragePortIn; +import app.module.core.usecase.file.saveToStorage.ports.application.domain.SaveToStorage; +import app.module.core.usecase.file.url.application.port.in.FileUrlPortIn; +import java.io.IOException; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.multipart.MultipartFile; + +@Controller +@RequiredArgsConstructor +public class EditorImageUploadController { + + private final SaveToStoragePortIn saveToStoragePortIn; + private final FileUrlPortIn fileUrlPortIn; + + @PostMapping(path = "/api/editorImage/upload") + ResponseEntity editorImageUpload(MultipartFile editorImage) throws IOException { + SaveToStorage saveToStorage = + saveToStoragePortIn.operate(FileUploadType.EDITOR_IMAGE, editorImage).orElseThrow(); + + return ResponseEntity.status(HttpStatus.OK) + .body( + fileUrlPortIn.getInline( + saveToStorage.getType().getFileStorageType(), + saveToStorage.getPath(), + saveToStorage.getName())); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/EmailController.java b/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/EmailController.java new file mode 100644 index 00000000..afa525ef --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/EmailController.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.email.send.adapters.web; + +import app.module.admin.usecase.email.send.adapters.web.model.EmailVO; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +public class EmailController { + + @GetMapping(path = "/addons/email/form") + public String emailForm(@ModelAttribute("formDto") EmailVO emailVO) { + return "email/emailForm"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/EmailSendController.java b/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/EmailSendController.java new file mode 100644 index 00000000..ea176ea9 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/EmailSendController.java @@ -0,0 +1,50 @@ +package app.module.admin.usecase.email.send.adapters.web; + +import app.module.admin.usecase.email.send.adapters.web.model.EmailVO; +import app.module.admin.usecase.email.send.ports.EmailSendPortIn; +import app.module.admin.usecase.email.send.ports.application.domain.Email; +import app.module.core.config.application.util.MessageUtil; +import jakarta.mail.MessagingException; +import jakarta.validation.Valid; +import java.io.IOException; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +@Controller +@RequiredArgsConstructor +public class EmailSendController { + + private final EmailSendPortIn emailSendPortIn; + private final MessageUtil messageUtil; + + @PostMapping(path = "/addons/email/form") + public String sendEmail( + RedirectAttributes redirectAttributes, + @Valid @ModelAttribute("formDto") EmailVO emailVO, + BindingResult bindingResult) + throws IOException, MessagingException { + + if (bindingResult.hasErrors()) { + return "email/emailForm"; + } + + emailSendPortIn.connect( + new Email( + emailVO.getTo(), + null, + emailVO.getSubject(), + emailVO.getMsgType(), + emailVO.getMessage(), + emailVO.getMultipartFiles())); + + redirectAttributes.addFlashAttribute( + "operationMessage", + messageUtil.getMessage("operation.common.email.to", emailVO.getTo())); + + return "redirect:/addons/email/form"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/model/EmailVO.java b/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/model/EmailVO.java new file mode 100644 index 00000000..d9df02f4 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/email/send/adapters/web/model/EmailVO.java @@ -0,0 +1,25 @@ +package app.module.admin.usecase.email.send.adapters.web.model; + +import jakarta.validation.constraints.NotEmpty; +import java.util.List; +import lombok.Builder; +import lombok.Data; +import org.springframework.web.multipart.MultipartFile; + +@Data +@Builder +public class EmailVO { + + @NotEmpty(message = "{valid.common.required}") + private String to; + + @NotEmpty(message = "{valid.common.required}") + private String subject; + + private String msgType; + + @NotEmpty(message = "{valid.common.required}") + private String message; + + private List multipartFiles; +} diff --git a/admin/src/main/java/app/module/admin/usecase/email/send/ports/EmailSendPortIn.java b/admin/src/main/java/app/module/admin/usecase/email/send/ports/EmailSendPortIn.java new file mode 100644 index 00000000..e739616a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/email/send/ports/EmailSendPortIn.java @@ -0,0 +1,10 @@ +package app.module.admin.usecase.email.send.ports; + +import app.module.admin.usecase.email.send.ports.application.domain.Email; +import jakarta.mail.MessagingException; +import java.io.UnsupportedEncodingException; + +public interface EmailSendPortIn { + + void connect(Email email) throws MessagingException, UnsupportedEncodingException; +} diff --git a/admin/src/main/java/app/module/admin/usecase/email/send/ports/application/EmailSendService.java b/admin/src/main/java/app/module/admin/usecase/email/send/ports/application/EmailSendService.java new file mode 100644 index 00000000..b86f7700 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/email/send/ports/application/EmailSendService.java @@ -0,0 +1,46 @@ +package app.module.admin.usecase.email.send.ports.application; + +import app.module.admin.usecase.email.send.ports.EmailSendPortIn; +import app.module.admin.usecase.email.send.ports.application.domain.Email; +import jakarta.mail.MessagingException; +import jakarta.mail.internet.MimeMessage; +import jakarta.mail.internet.MimeUtility; +import java.io.UnsupportedEncodingException; +import java.util.Objects; +import lombok.RequiredArgsConstructor; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.mail.javamail.JavaMailSender; +import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; + +@Service +@RequiredArgsConstructor +class EmailSendService implements EmailSendPortIn { + + private final JavaMailSender mailSender; + + @Value("${spring.mail.username}") + private String mailUsername; + + @Override + public void connect(Email email) throws MessagingException, UnsupportedEncodingException { + MimeMessage mimeMessage = mailSender.createMimeMessage(); + MimeMessageHelper mimeMessageHelper = new MimeMessageHelper(mimeMessage, true, "UTF-8"); + mimeMessageHelper.setTo(email.getTo()); + mimeMessageHelper.setFrom(email.getFrom() != null ? email.getFrom() : mailUsername); + mimeMessageHelper.setSubject(MimeUtility.encodeText(email.getSubject(), "UTF-8", "B")); + mimeMessageHelper.setText(email.getMessage(), "HTML".equals(email.getMsgType())); + + if (email.getMultipartFiles() != null) { + for (MultipartFile multipartFile : email.getMultipartFiles()) { + if (!multipartFile.isEmpty()) { + mimeMessageHelper.addAttachment( + Objects.requireNonNull(multipartFile.getOriginalFilename()), multipartFile); + } + } + } + + mailSender.send(mimeMessage); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/email/send/ports/application/domain/Email.java b/admin/src/main/java/app/module/admin/usecase/email/send/ports/application/domain/Email.java new file mode 100644 index 00000000..15a65202 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/email/send/ports/application/domain/Email.java @@ -0,0 +1,22 @@ +package app.module.admin.usecase.email.send.ports.application.domain; + +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import org.springframework.web.multipart.MultipartFile; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class Email { + + private String to; + private String from; + private String subject; + private String msgType; + private String message; + private List multipartFiles; +} diff --git a/admin/src/main/java/app/module/admin/usecase/home/adapters/web/HomeController.java b/admin/src/main/java/app/module/admin/usecase/home/adapters/web/HomeController.java new file mode 100644 index 00000000..41bb2360 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/home/adapters/web/HomeController.java @@ -0,0 +1,30 @@ +package app.module.admin.usecase.home.adapters.web; + +import app.module.core.usecase.admin.view.ports.AdminViewPortIn; +import java.security.Principal; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequestMapping("/") +@RequiredArgsConstructor +public class HomeController { + + private final AdminViewPortIn adminViewPortIn; + + @GetMapping + public String home(Principal principal, Model model) { + adminViewPortIn + .connect(principal.getName()) + .ifPresent( + loginUser -> { + model.addAttribute("loginUser", loginUser); + model.addAttribute("loginUserRoles", loginUser.getRoles()); + }); + + return "home"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/LoggedInUserRemoveDao.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/LoggedInUserRemoveDao.java new file mode 100644 index 00000000..f6b5f69a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/LoggedInUserRemoveDao.java @@ -0,0 +1,29 @@ +package app.module.admin.usecase.loggedinuser.remove.adapters.persistence; + +import app.module.admin.usecase.loggedinuser.remove.adapters.persistence.model.LoggedInUserRemoveParam; +import app.module.admin.usecase.loggedinuser.remove.ports.LoggedInUserRemovePortOut; +import app.module.admin.usecase.loggedinuser.remove.ports.application.domain.LoggedInUserRemoveCmd; +import app.module.core.config.application.util.CommonUtil; +import java.time.LocalDateTime; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Repository; + +@Repository +@RequiredArgsConstructor +public class LoggedInUserRemoveDao implements LoggedInUserRemovePortOut { + + private final LoggedInUserRemoveMapper mapper; + + @Override + public void connect(LoggedInUserRemoveCmd removeCommand) { + mapper.deleteByCompositeId(new LoggedInUserRemoveParam( + removeCommand.getAppType(), + removeCommand.getId(), + LocalDateTime.now(), + CommonUtil.getLoginUsername(), + LocalDateTime.now(), + CommonUtil.getLoginUsername(), + false + )); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/LoggedInUserRemoveMapper.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/LoggedInUserRemoveMapper.java new file mode 100644 index 00000000..3dfc4f1c --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/LoggedInUserRemoveMapper.java @@ -0,0 +1,10 @@ +package app.module.admin.usecase.loggedinuser.remove.adapters.persistence; + + +import app.module.admin.usecase.loggedinuser.remove.adapters.persistence.model.LoggedInUserRemoveParam; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface LoggedInUserRemoveMapper { + void deleteByCompositeId(LoggedInUserRemoveParam param); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/model/LoggedInUserRemoveParam.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/model/LoggedInUserRemoveParam.java new file mode 100644 index 00000000..3da6cf8f --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/adapters/persistence/model/LoggedInUserRemoveParam.java @@ -0,0 +1,20 @@ +package app.module.admin.usecase.loggedinuser.remove.adapters.persistence.model; + +import app.module.core.config.application.enums.AppType; +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class LoggedInUserRemoveParam { + private AppType appType; + private String id; + private LocalDateTime updatedAt; + private String updatedBy; + private LocalDateTime deletedAt; + private String deletedBy; + private Boolean isDeleted; +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/LoggedInUserRemovePortIn.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/LoggedInUserRemovePortIn.java new file mode 100644 index 00000000..ca3e6fe1 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/LoggedInUserRemovePortIn.java @@ -0,0 +1,8 @@ +package app.module.admin.usecase.loggedinuser.remove.ports; + +import app.module.admin.usecase.loggedinuser.remove.ports.application.domain.LoggedInUserRemoveCmd; + +public interface LoggedInUserRemovePortIn { + + void connect(LoggedInUserRemoveCmd loggedInUserId); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/LoggedInUserRemovePortOut.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/LoggedInUserRemovePortOut.java new file mode 100644 index 00000000..085fad5c --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/LoggedInUserRemovePortOut.java @@ -0,0 +1,8 @@ +package app.module.admin.usecase.loggedinuser.remove.ports; + +import app.module.admin.usecase.loggedinuser.remove.ports.application.domain.LoggedInUserRemoveCmd; + +public interface LoggedInUserRemovePortOut { + + void connect(LoggedInUserRemoveCmd removeCommand); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/application/LoggedInUserRemoveService.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/application/LoggedInUserRemoveService.java new file mode 100644 index 00000000..c38b0260 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/application/LoggedInUserRemoveService.java @@ -0,0 +1,19 @@ +package app.module.admin.usecase.loggedinuser.remove.ports.application; + +import app.module.admin.usecase.loggedinuser.remove.ports.LoggedInUserRemovePortIn; +import app.module.admin.usecase.loggedinuser.remove.ports.LoggedInUserRemovePortOut; +import app.module.admin.usecase.loggedinuser.remove.ports.application.domain.LoggedInUserRemoveCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class LoggedInUserRemoveService implements LoggedInUserRemovePortIn { + + private final LoggedInUserRemovePortOut portOut; + + @Override + public void connect(LoggedInUserRemoveCmd removeCommand) { + portOut.connect(removeCommand); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/application/domain/LoggedInUserRemoveCmd.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/application/domain/LoggedInUserRemoveCmd.java new file mode 100644 index 00000000..d4939d0d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/remove/ports/application/domain/LoggedInUserRemoveCmd.java @@ -0,0 +1,18 @@ +package app.module.admin.usecase.loggedinuser.remove.ports.application.domain; + +import app.module.core.config.application.enums.AppType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class LoggedInUserRemoveCmd { + private AppType appType; + private String id; +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java new file mode 100644 index 00000000..cd3226ee --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveDao.java @@ -0,0 +1,40 @@ +package app.module.admin.usecase.loggedinuser.save.adapter.persistence; + +import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortOut; +import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; +import app.module.admin.usecase.loggedinuser.view.adapters.persistence.LoggedInUserViewMapper; +import app.module.admin.usecase.loggedinuser.view.adapters.persistence.model.LoggedInUserDto; +import app.module.core.config.adapters.persistence.entity.LoggedInUser; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Repository; + +@Repository +@RequiredArgsConstructor +public class LoggedInUserSaveDao implements LoggedInUserSavePortOut { + + private final LoggedInUserSaveMapper mapper; + private final LoggedInUserViewMapper viewMapper; + + @Override + public void connect(LoggedInUserSaveCmd saveCommand) { + + Optional existedLoggedInUser = + viewMapper.findByCompositeKey( + saveCommand.getLoggedInUserId().getAppType(), + saveCommand.getLoggedInUserId().getId()); + + LoggedInUser loggedInUser = new LoggedInUser( + saveCommand.getLoggedInUserId().getAppType(), + saveCommand.getLoggedInUserId().getId(), + saveCommand.getClientIP(), + saveCommand.getLastLoggedInAt() + ); + + if (existedLoggedInUser.isPresent()) { + mapper.update(loggedInUser); + } else { + mapper.insert(loggedInUser); + } + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java new file mode 100644 index 00000000..fc3cc9e8 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/adapter/persistence/LoggedInUserSaveMapper.java @@ -0,0 +1,10 @@ +package app.module.admin.usecase.loggedinuser.save.adapter.persistence; + +import app.module.core.config.adapters.persistence.entity.LoggedInUser; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface LoggedInUserSaveMapper { + void insert(LoggedInUser loggedInUser); + void update(LoggedInUser loggedInUser); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java new file mode 100644 index 00000000..d410403c --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortIn.java @@ -0,0 +1,8 @@ +package app.module.admin.usecase.loggedinuser.save.ports; + +import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; + +public interface LoggedInUserSavePortIn { + + void connect(LoggedInUserSaveCmd loggedInUserSaveCmd); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java new file mode 100644 index 00000000..8da77957 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/LoggedInUserSavePortOut.java @@ -0,0 +1,8 @@ +package app.module.admin.usecase.loggedinuser.save.ports; + +import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; + +public interface LoggedInUserSavePortOut { + + void connect(LoggedInUserSaveCmd loggedInUser); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java new file mode 100644 index 00000000..0dc5b3ec --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/LoggedInUserSaveService.java @@ -0,0 +1,19 @@ +package app.module.admin.usecase.loggedinuser.save.ports.application; + +import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortIn; +import app.module.admin.usecase.loggedinuser.save.ports.LoggedInUserSavePortOut; +import app.module.admin.usecase.loggedinuser.save.ports.application.domain.LoggedInUserSaveCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class LoggedInUserSaveService implements LoggedInUserSavePortIn { + + private final LoggedInUserSavePortOut portOut; + + @Override + public void connect(LoggedInUserSaveCmd loggedInUserSaveCmd) { + portOut.connect(loggedInUserSaveCmd); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java new file mode 100644 index 00000000..37b2318b --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserIdSaveCmd.java @@ -0,0 +1,19 @@ +package app.module.admin.usecase.loggedinuser.save.ports.application.domain; + +import app.module.core.config.application.enums.AppType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class LoggedInUserIdSaveCmd { + private AppType appType; + private String id; +} + diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java new file mode 100644 index 00000000..b18198bd --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/save/ports/application/domain/LoggedInUserSaveCmd.java @@ -0,0 +1,19 @@ +package app.module.admin.usecase.loggedinuser.save.ports.application.domain; + +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Builder +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class LoggedInUserSaveCmd { + private LoggedInUserIdSaveCmd loggedInUserId; + private String clientIP; + private LocalDateTime lastLoggedInAt; +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/LoggedInUserViewDao.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/LoggedInUserViewDao.java new file mode 100644 index 00000000..ad63c70d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/LoggedInUserViewDao.java @@ -0,0 +1,26 @@ +package app.module.admin.usecase.loggedinuser.view.adapters.persistence; + +import app.module.admin.usecase.loggedinuser.view.adapters.persistence.model.LoggedInUserDto; +import app.module.admin.usecase.loggedinuser.view.ports.LoggedInUserViewPortOut; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserIdCmd; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserView; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Repository; + +@Repository +@RequiredArgsConstructor +public class LoggedInUserViewDao implements LoggedInUserViewPortOut { + + private final LoggedInUserViewMapper mapper; + + @Override + public LoggedInUserView connect(LoggedInUserIdCmd userCommand) { + return mapper.findByCompositeKey(userCommand.getAppType(), userCommand.getId()) + .map(d -> new LoggedInUserView( + new LoggedInUserIdCmd(d.getAppType(), d.getId()), + d.getClientIP(), + d.getLastLoggedInAt() + )).orElse(null); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/LoggedInUserViewMapper.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/LoggedInUserViewMapper.java new file mode 100644 index 00000000..8f93e57e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/LoggedInUserViewMapper.java @@ -0,0 +1,11 @@ +package app.module.admin.usecase.loggedinuser.view.adapters.persistence; + +import app.module.admin.usecase.loggedinuser.view.adapters.persistence.model.LoggedInUserDto; +import app.module.core.config.application.enums.AppType; +import java.util.Optional; +import org.apache.ibatis.annotations.Mapper; + +@Mapper +public interface LoggedInUserViewMapper { + Optional findByCompositeKey(AppType appType, String id); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/model/LoggedInUserDto.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/model/LoggedInUserDto.java new file mode 100644 index 00000000..6589f04a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/adapters/persistence/model/LoggedInUserDto.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.loggedinuser.view.adapters.persistence.model; + +import app.module.core.config.application.enums.AppType; +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class LoggedInUserDto { + private AppType appType; + private String id; + private String clientIP; + private LocalDateTime lastLoggedInAt; +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/LoggedInUserViewPortIn.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/LoggedInUserViewPortIn.java new file mode 100644 index 00000000..f97de33b --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/LoggedInUserViewPortIn.java @@ -0,0 +1,9 @@ +package app.module.admin.usecase.loggedinuser.view.ports; + +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserIdCmd; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserView; + +public interface LoggedInUserViewPortIn { + + LoggedInUserView connect(LoggedInUserIdCmd userCommand); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/LoggedInUserViewPortOut.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/LoggedInUserViewPortOut.java new file mode 100644 index 00000000..39e3f8a3 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/LoggedInUserViewPortOut.java @@ -0,0 +1,9 @@ +package app.module.admin.usecase.loggedinuser.view.ports; + +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserIdCmd; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserView; + +public interface LoggedInUserViewPortOut { + + LoggedInUserView connect(LoggedInUserIdCmd userCommand); +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/LoggedInUserViewService.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/LoggedInUserViewService.java new file mode 100644 index 00000000..8a03b013 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/LoggedInUserViewService.java @@ -0,0 +1,20 @@ +package app.module.admin.usecase.loggedinuser.view.ports.application; + +import app.module.admin.usecase.loggedinuser.view.ports.LoggedInUserViewPortIn; +import app.module.admin.usecase.loggedinuser.view.ports.LoggedInUserViewPortOut; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserIdCmd; +import app.module.admin.usecase.loggedinuser.view.ports.application.domain.LoggedInUserView; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@Service +@RequiredArgsConstructor +public class LoggedInUserViewService implements LoggedInUserViewPortIn { + + private final LoggedInUserViewPortOut portOut; + + @Override + public LoggedInUserView connect(LoggedInUserIdCmd userCommand) { + return portOut.connect(userCommand); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/domain/LoggedInUserIdCmd.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/domain/LoggedInUserIdCmd.java new file mode 100644 index 00000000..43ceda25 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/domain/LoggedInUserIdCmd.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.loggedinuser.view.ports.application.domain; + +import app.module.core.config.application.enums.AppType; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@Builder +@AllArgsConstructor +public class LoggedInUserIdCmd { + private AppType appType; + private String id; +} diff --git a/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/domain/LoggedInUserView.java b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/domain/LoggedInUserView.java new file mode 100644 index 00000000..246ede97 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/loggedinuser/view/ports/application/domain/LoggedInUserView.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.loggedinuser.view.ports.application.domain; + +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class LoggedInUserView { + private LoggedInUserIdCmd loggedInUserId; + private String clientIP; + private LocalDateTime lastLoggedInAt; +} diff --git a/admin/src/main/java/app/module/admin/usecase/login/adapters/web/LoginController.java b/admin/src/main/java/app/module/admin/usecase/login/adapters/web/LoginController.java new file mode 100644 index 00000000..4dd02b95 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/login/adapters/web/LoginController.java @@ -0,0 +1,13 @@ +package app.module.admin.usecase.login.adapters.web; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +public class LoginController { + + @GetMapping("/login") + public String login() { + return "security/login"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/OperationLogListController.java b/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/OperationLogListController.java new file mode 100644 index 00000000..f96209e5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/OperationLogListController.java @@ -0,0 +1,45 @@ +package app.module.admin.usecase.operationlog.list.adapters.web; + +import app.module.admin.usecase.operationlog.list.adapters.web.model.OperationLogListFilterVO; +import app.module.core.usecase.operationlog.list.application.domain.OperationLogElement; +import app.module.core.usecase.operationlog.list.application.domain.OperationLogListFilterCommand; +import app.module.core.usecase.operationlog.list.application.port.in.OperationLogListPortIn; +import app.module.core.usecase.uicode.list.ports.UICodeListPortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.PageableDefault; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +public class OperationLogListController { + + private final OperationLogListPortIn operationLogListPortIn; + private final UICodeListPortIn uiCodeListPortIn; + + @GetMapping("/analysis/operationlog") + String operate( + Model model, + @PageableDefault(sort = "createdAt", direction = Direction.DESC) Pageable pageable, + @ModelAttribute("paramDto") OperationLogListFilterVO statusVO) { + + Page listOutput = + operationLogListPortIn.connect( + pageable, + new OperationLogListFilterCommand( + statusVO.getSearchField(), + statusVO.getSearchValue(), + statusVO.getSearchAppType(), + statusVO.getSearchOperationType())); + + model.addAttribute("listOutput", listOutput); + model.addAttribute("pageRows", uiCodeListPortIn.connect("code.pageable.rows")); + + return "operationLog/operationLogList"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/OperationLogListExcelController.java b/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/OperationLogListExcelController.java new file mode 100644 index 00000000..999d0d5e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/OperationLogListExcelController.java @@ -0,0 +1,81 @@ +package app.module.admin.usecase.operationlog.list.adapters.web; + +import app.module.admin.usecase.operationlog.list.adapters.web.model.OperationLogListFilterVO; +import app.module.core.config.application.util.ExcelUtil; +import app.module.core.usecase.operationlog.list.application.domain.OperationLogElement; +import app.module.core.usecase.operationlog.list.application.domain.OperationLogListFilterCommand; +import app.module.core.usecase.operationlog.list.application.port.in.OperationLogListPortIn; +import jakarta.servlet.http.HttpServletResponse; +import java.time.format.DateTimeFormatter; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort.Direction; +import org.springframework.data.web.PageableDefault; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +public class OperationLogListExcelController { + + private final ExcelUtil excelUtil; + private final OperationLogListPortIn operationLogListPortIn; + + @GetMapping("/analysis/operationlog/excel") + public void operate( + HttpServletResponse response, + @PageableDefault(sort = "createdAt", direction = Direction.DESC) Pageable pageable, + @ModelAttribute("paramDto") OperationLogListFilterVO statusVO) { + Workbook wb = new XSSFWorkbook(); + Sheet sheet = wb.createSheet("수행로그 목록"); + + Page listOutput = + operationLogListPortIn.connect( + pageable, + new OperationLogListFilterCommand( + statusVO.getSearchField(), + statusVO.getSearchValue(), + statusVO.getSearchAppType(), + statusVO.getSearchOperationType())); + + if (CollectionUtils.isNotEmpty(listOutput.getContent())) { + // Header + Row headerRow = sheet.createRow(sheet.getPhysicalNumberOfRows()); + excelUtil.createCells( + headerRow, "로그 ID", "App Type", "Operation Type", "IP", "수행일", "수행자", "피수행자", + "수행 내용"); + + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"); + + listOutput + .getContent() + .forEach( + item -> { + Row row = sheet.createRow(sheet.getPhysicalNumberOfRows()); + + excelUtil.createCells( + row, + item.getId(), + item.getAppType().name(), + item.getOperationLogType().name(), + item.getIp(), + Optional.ofNullable(item.getCreatedAt()) + .map(localDateTime -> localDateTime.format(formatter)) + .orElse(""), + item.getCreatedBy(), + item.getTargetId(), + item.getTaskDesc()); + }); + } + + excelUtil.generateWithPassword(response, wb, "operation-logs"); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/model/OperationLogListFilterVO.java b/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/model/OperationLogListFilterVO.java new file mode 100644 index 00000000..83a9c527 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/operationlog/list/adapters/web/model/OperationLogListFilterVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.operationlog.list.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class OperationLogListFilterVO { + + private String searchField; + private String searchValue; + private String searchAppType; + private String searchOperationType; +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/index/adapters/web/PrivilegeIndexController.java b/admin/src/main/java/app/module/admin/usecase/privileges/index/adapters/web/PrivilegeIndexController.java new file mode 100644 index 00000000..cb0cdbbe --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/index/adapters/web/PrivilegeIndexController.java @@ -0,0 +1,22 @@ +package app.module.admin.usecase.privileges.index.adapters.web; + +import app.module.core.config.application.enums.AppType; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +@Controller +@RequiredArgsConstructor +@RequestMapping("/settings/adminPrivilege") +@Slf4j +class PrivilegeIndexController { + + @GetMapping + String intro(Model model) { + model.addAttribute("appType", AppType.ADMIN); + return "privilege/privilegeList"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/list/adapters/web/PrivilegeListRestController.java b/admin/src/main/java/app/module/admin/usecase/privileges/list/adapters/web/PrivilegeListRestController.java new file mode 100644 index 00000000..5a4107a9 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/list/adapters/web/PrivilegeListRestController.java @@ -0,0 +1,41 @@ +package app.module.admin.usecase.privileges.list.adapters.web; + +import app.module.admin.usecase.privileges.list.adapters.web.model.PrivilegeElementVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.privilege.list.ports.PrivilegeListPortIn; +import app.module.core.usecase.privilege.list.ports.application.domain.PrivilegeElement; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class PrivilegeListRestController { + + private final PrivilegeListPortIn listPortIn; + + @GetMapping("/api/adminPrivilege/get/recursiveItems") + ResponseEntity operate() { + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .items( + listPortIn.connect(AppType.ADMIN).stream() + .map( + p -> + new PrivilegeElementVO( + p.getCreatedBy(), + p.getCreatedAt(), + p.getUpdatedBy(), + p.getUpdatedAt(), + p.getId(), + p.getDescription(), + p.getOrderNo())) + .collect(Collectors.toList())) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/list/adapters/web/model/PrivilegeElementVO.java b/admin/src/main/java/app/module/admin/usecase/privileges/list/adapters/web/model/PrivilegeElementVO.java new file mode 100644 index 00000000..96dd1ceb --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/list/adapters/web/model/PrivilegeElementVO.java @@ -0,0 +1,32 @@ +package app.module.admin.usecase.privileges.list.adapters.web.model; + +import app.module.core.config.application.converter.CustomLocalDateTimeSerializer; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class PrivilegeElementVO { + + private final String createdBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime createdAt; + + private final String updatedBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime updatedAt; + + private final String id; + private final String description; + private final Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/remove/adapters/web/PrivilegeRemoveRestController.java b/admin/src/main/java/app/module/admin/usecase/privileges/remove/adapters/web/PrivilegeRemoveRestController.java new file mode 100644 index 00000000..a95d5b06 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/remove/adapters/web/PrivilegeRemoveRestController.java @@ -0,0 +1,29 @@ +package app.module.admin.usecase.privileges.remove.adapters.web; + +import app.module.admin.usecase.privileges.remove.adapters.web.model.RoleRemoveVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.privilege.remove.ports.PrivilegeRemovePortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class PrivilegeRemoveRestController { + + private final PrivilegeRemovePortIn removePortIn; + private final MessageUtil messageUtil; + + @PostMapping("/api/adminPrivilege/remove") + ResponseEntity remove(RoleRemoveVO formDto) { + removePortIn.connect(formDto.getId()); + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .message(messageUtil.getMessage("operation.common.remove.done")) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/remove/adapters/web/model/RoleRemoveVO.java b/admin/src/main/java/app/module/admin/usecase/privileges/remove/adapters/web/model/RoleRemoveVO.java new file mode 100644 index 00000000..6e2cf99a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/remove/adapters/web/model/RoleRemoveVO.java @@ -0,0 +1,13 @@ +package app.module.admin.usecase.privileges.remove.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class RoleRemoveVO { + + private String id; +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/save/adapters/web/PrivilegeSaveRestController.java b/admin/src/main/java/app/module/admin/usecase/privileges/save/adapters/web/PrivilegeSaveRestController.java new file mode 100644 index 00000000..207f315c --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/save/adapters/web/PrivilegeSaveRestController.java @@ -0,0 +1,56 @@ +package app.module.admin.usecase.privileges.save.adapters.web; + +import app.module.admin.usecase.privileges.save.adapters.web.model.PrivilegeSaveBindingVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.exception.AlreadyExistsRoleException; +import app.module.core.config.application.util.CoreUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.privilege.save.ports.PrivilegeSavePortIn; +import app.module.core.usecase.privilege.save.ports.application.domain.PrivilegeSaveCommand; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class PrivilegeSaveRestController { + + private final CoreUtil coreUtil; + private final MessageUtil messageUtil; + private final PrivilegeSavePortIn savePortIn; + + @PostMapping("/api/adminPrivilege/save") + ResponseEntity operate(@Valid PrivilegeSaveBindingVO bindingVO, + BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return coreUtil.getErrorInfo(bindingResult); + } + + PrivilegeSaveCommand saveInput = + new PrivilegeSaveCommand( + AppType.ADMIN, bindingVO.getId(), bindingVO.getDescription(), bindingVO.getOrderNo()); + + try { + savePortIn.connect(saveInput); + + // `create` 인 경우 save 과정에서 orderNo 가 생성된다. + bindingVO.setOrderNo(saveInput.getOrderNo()); + + } catch (AlreadyExistsRoleException e) { + bindingResult.rejectValue("id", "", e.getMessage()); + return coreUtil.getErrorInfo(bindingResult); + } + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .item(bindingVO) + .message(messageUtil.getMessage("operation.common.save.done")) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/save/adapters/web/model/PrivilegeSaveBindingVO.java b/admin/src/main/java/app/module/admin/usecase/privileges/save/adapters/web/model/PrivilegeSaveBindingVO.java new file mode 100644 index 00000000..1a16f3d5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/save/adapters/web/model/PrivilegeSaveBindingVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.privileges.save.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class PrivilegeSaveBindingVO { + + private final String id; + private final String description; + private Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/sort/adapters/web/PrivilegeSortRestController.java b/admin/src/main/java/app/module/admin/usecase/privileges/sort/adapters/web/PrivilegeSortRestController.java new file mode 100644 index 00000000..e3505a79 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/sort/adapters/web/PrivilegeSortRestController.java @@ -0,0 +1,30 @@ +package app.module.admin.usecase.privileges.sort.adapters.web; + +import app.module.admin.usecase.privileges.sort.adapters.web.model.PrivilegeSortVO; +import app.module.core.usecase.privilege.sort.ports.PrivilegeSortPortIn; +import app.module.core.usecase.privilege.sort.ports.application.domain.PrivilegeSortCmd; +import java.util.List; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class PrivilegeSortRestController { + + private final PrivilegeSortPortIn sortPortIn; + + @PostMapping("/api/adminPrivilege/switchOrderNo") + ResponseEntity switchOrderNo(@RequestBody List sortVOs) { + sortPortIn.connect( + sortVOs.stream() + .map(s -> new PrivilegeSortCmd(s.getId(), s.getOrderNo())) + .collect(Collectors.toList())); + + return ResponseEntity.status(HttpStatus.OK).body(null); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/sort/adapters/web/model/PrivilegeSortVO.java b/admin/src/main/java/app/module/admin/usecase/privileges/sort/adapters/web/model/PrivilegeSortVO.java new file mode 100644 index 00000000..654f774a --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/sort/adapters/web/model/PrivilegeSortVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.privileges.sort.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class PrivilegeSortVO { + + private String id; + private Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/view/adapters/web/PrivilegeViewRestController.java b/admin/src/main/java/app/module/admin/usecase/privileges/view/adapters/web/PrivilegeViewRestController.java new file mode 100644 index 00000000..9083e328 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/view/adapters/web/PrivilegeViewRestController.java @@ -0,0 +1,47 @@ +package app.module.admin.usecase.privileges.view.adapters.web; + +import app.module.admin.usecase.privileges.view.adapters.web.model.PrivilegeViewVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.privilege.view.ports.PrivilegeViewPortIn; +import app.module.core.usecase.privilege.view.ports.application.domain.PrivilegeView; +import java.util.NoSuchElementException; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class PrivilegeViewRestController { + + private final MessageUtil messageUtil; + private final PrivilegeViewPortIn privilegeViewPortIn; + + @GetMapping("/api/adminPrivilege/get/{id}") + ResponseEntity view(@PathVariable String id) { + PrivilegeView item = + Optional.ofNullable(privilegeViewPortIn.connect(id)) + .orElseThrow( + () -> + new NoSuchElementException( + messageUtil.getMessage("exception.noSuchElement", id, "ROLE ID"))); + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .item( + new PrivilegeViewVO( + item.getCreatedBy(), + item.getCreatedAt(), + item.getUpdatedBy(), + item.getUpdatedAt(), + item.getId(), + item.getDescription(), + item.getOrderNo())) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/privileges/view/adapters/web/model/PrivilegeViewVO.java b/admin/src/main/java/app/module/admin/usecase/privileges/view/adapters/web/model/PrivilegeViewVO.java new file mode 100644 index 00000000..f98e5996 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/privileges/view/adapters/web/model/PrivilegeViewVO.java @@ -0,0 +1,32 @@ +package app.module.admin.usecase.privileges.view.adapters.web.model; + +import app.module.core.config.application.converter.CustomLocalDateTimeSerializer; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import java.time.LocalDateTime; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class PrivilegeViewVO { + + private final String createdBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime createdAt; + + private final String updatedBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime updatedAt; + + private final String id; + private final String description; + private final Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/index/adapters/web/RoleIndexUIController.java b/admin/src/main/java/app/module/admin/usecase/role/index/adapters/web/RoleIndexUIController.java new file mode 100644 index 00000000..e9268618 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/index/adapters/web/RoleIndexUIController.java @@ -0,0 +1,24 @@ +package app.module.admin.usecase.role.index.adapters.web; + +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.privilege.list.ports.PrivilegeListPortIn; +import app.module.core.usecase.privilege.list.ports.application.domain.PrivilegeElement; +import groovy.util.logging.Slf4j; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +@RequiredArgsConstructor +@Slf4j +class RoleIndexUIController { + + private final PrivilegeListPortIn privilegeListPortIn; + + @GetMapping("/settings/adminRoles") + String intro(Model model) { + model.addAttribute("privileges", privilegeListPortIn.connect(AppType.ADMIN)); + return "adminRole/adminRoleList"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/RoleListRestController.java b/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/RoleListRestController.java new file mode 100644 index 00000000..2e38b3bc --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/RoleListRestController.java @@ -0,0 +1,47 @@ +package app.module.admin.usecase.role.list.adapters.web; + +import app.module.admin.usecase.role.view.adapters.web.model.RoleBindingVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.role.list.ports.RoleListPortIn; +import app.module.core.usecase.role.list.ports.application.domain.PrivilegeElement; +import app.module.core.usecase.role.list.ports.application.domain.RoleElement; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RoleListRestController { + + private final RoleListPortIn roleListPortIn; + + @GetMapping("/api/adminRole/get/recursiveItems") + ResponseEntity operate() { + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .items( + roleListPortIn.connect(AppType.ADMIN).stream() + .map( + item -> + new RoleBindingVO( + item.getCreatedBy(), + item.getCreatedAt(), + item.getUpdatedBy(), + item.getUpdatedAt(), + item.getId(), + item.getDescription(), + item.getOrderNo(), + CollectionUtils.emptyIfNull(item.getPrivileges()).stream() + .map(PrivilegeElement::getId) + .collect(Collectors.toList()))) + .collect(Collectors.toList())) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/model/PrivilegeBindingVO.java b/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/model/PrivilegeBindingVO.java new file mode 100644 index 00000000..1f8a64b6 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/model/PrivilegeBindingVO.java @@ -0,0 +1,14 @@ +package app.module.admin.usecase.role.list.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class PrivilegeBindingVO { + + private final String id; + private final String description; +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/model/RoleBindingVO.java b/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/model/RoleBindingVO.java new file mode 100644 index 00000000..ecd4942e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/list/adapters/web/model/RoleBindingVO.java @@ -0,0 +1,34 @@ +package app.module.admin.usecase.role.list.adapters.web.model; + +import app.module.core.config.application.converter.CustomLocalDateTimeSerializer; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import java.time.LocalDateTime; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class RoleBindingVO { + + private final String createdBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime createdAt; + + private final String updatedBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime updatedAt; + + private final String id; + private final String description; + private final Integer orderNo; + private List privileges; +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/removeRole/adapters/web/RoleRemoveRestController.java b/admin/src/main/java/app/module/admin/usecase/role/removeRole/adapters/web/RoleRemoveRestController.java new file mode 100644 index 00000000..e8d23691 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/removeRole/adapters/web/RoleRemoveRestController.java @@ -0,0 +1,29 @@ +package app.module.admin.usecase.role.removeRole.adapters.web; + +import app.module.admin.usecase.privileges.remove.adapters.web.model.RoleRemoveVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.role.remove.ports.RoleRemovePortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RoleRemoveRestController { + + private final RoleRemovePortIn roleRemovePortIn; + private final MessageUtil messageUtil; + + @PostMapping("/api/adminRole/remove") + ResponseEntity remove(RoleRemoveVO formDto) { + roleRemovePortIn.connect(formDto.getId()); + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .message(messageUtil.getMessage("operation.common.remove.done")) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/saveRole/adapters/web/RoleSaveRestController.java b/admin/src/main/java/app/module/admin/usecase/role/saveRole/adapters/web/RoleSaveRestController.java new file mode 100644 index 00000000..5a7b8af5 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/saveRole/adapters/web/RoleSaveRestController.java @@ -0,0 +1,52 @@ +package app.module.admin.usecase.role.saveRole.adapters.web; + +import app.module.admin.usecase.role.saveRole.adapters.web.model.RoleSaveBindingVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.exception.AlreadyExistsRoleException; +import app.module.core.config.application.util.CoreUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.role.save.ports.RoleSavePortIn; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RoleSaveRestController { + + private final CoreUtil coreUtil; + private final MessageUtil messageUtil; + private final RoleSavePortIn roleSavePortIn; + + @PostMapping("/api/adminRole/save") + ResponseEntity operate(@Valid RoleSaveBindingVO bindingVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return coreUtil.getErrorInfo(bindingResult); + } + + try { + roleSavePortIn.connect( + AppType.ADMIN, + bindingVO.getId(), + bindingVO.getDescription(), + bindingVO.getOrderNo(), + bindingVO.getPrivilegeIds()); + + } catch (AlreadyExistsRoleException e) { + bindingResult.rejectValue("id", "", e.getMessage()); + return coreUtil.getErrorInfo(bindingResult); + } + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .item(bindingVO) + .message(messageUtil.getMessage("operation.common.save.done")) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/saveRole/adapters/web/model/RoleSaveBindingVO.java b/admin/src/main/java/app/module/admin/usecase/role/saveRole/adapters/web/model/RoleSaveBindingVO.java new file mode 100644 index 00000000..66bf97c7 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/saveRole/adapters/web/model/RoleSaveBindingVO.java @@ -0,0 +1,24 @@ +package app.module.admin.usecase.role.saveRole.adapters.web.model; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@NoArgsConstructor +@AllArgsConstructor +public class RoleSaveBindingVO { + + @NotBlank(message = "{valid.common.required}") + @Pattern(regexp = "^(ROLE_).+", message = "{valid.adminRole.id.mustStartWith.role}") + private String id; + + @NotBlank(message = "{valid.common.required}") + private String description; + + private Integer orderNo; + private List privilegeIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/sortRoles/adapters/web/RoleSortRestController.java b/admin/src/main/java/app/module/admin/usecase/role/sortRoles/adapters/web/RoleSortRestController.java new file mode 100644 index 00000000..caf5a7ff --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/sortRoles/adapters/web/RoleSortRestController.java @@ -0,0 +1,30 @@ +package app.module.admin.usecase.role.sortRoles.adapters.web; + +import app.module.admin.usecase.role.sortRoles.adapters.web.model.RoleSortVO; +import app.module.core.usecase.role.sort.ports.RoleSortPortIn; +import app.module.core.usecase.role.sort.ports.application.domain.RoleSortCommand; +import java.util.List; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RoleSortRestController { + + private final RoleSortPortIn roleSortPortIn; + + @PostMapping("/api/adminRole/switchOrderNo") + ResponseEntity switchOrderNo(@RequestBody List sortVOs) { + roleSortPortIn.connect( + sortVOs.stream() + .map(item -> new RoleSortCommand(item.getId(), item.getOrderNo())) + .collect(Collectors.toList())); + + return ResponseEntity.status(HttpStatus.OK).body(null); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/sortRoles/adapters/web/model/RoleSortVO.java b/admin/src/main/java/app/module/admin/usecase/role/sortRoles/adapters/web/model/RoleSortVO.java new file mode 100644 index 00000000..19b1e3e2 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/sortRoles/adapters/web/model/RoleSortVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.role.sortRoles.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class RoleSortVO { + + private String id; + private Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/view/adapters/web/RoleViewRestController.java b/admin/src/main/java/app/module/admin/usecase/role/view/adapters/web/RoleViewRestController.java new file mode 100644 index 00000000..1cd1ade6 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/view/adapters/web/RoleViewRestController.java @@ -0,0 +1,48 @@ +package app.module.admin.usecase.role.view.adapters.web; + +import app.module.admin.usecase.role.view.adapters.web.model.RoleBindingVO; +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.role.view.ports.RoleViewPortIn; +import app.module.core.usecase.role.view.ports.application.domain.RoleView; +import java.util.NoSuchElementException; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RoleViewRestController { + + private final MessageUtil messageUtil; + private final RoleViewPortIn roleViewPortIn; + + @GetMapping("/api/adminRole/get/{role}") + ResponseEntity view(@PathVariable String role) { + RoleView item = + Optional.ofNullable(roleViewPortIn.connect(role)) + .orElseThrow( + () -> + new NoSuchElementException( + messageUtil.getMessage("exception.noSuchElement", role, "ROLE ID"))); + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .item( + new RoleBindingVO( + item.getCreatedBy(), + item.getCreatedAt(), + item.getUpdatedBy(), + item.getUpdatedAt(), + item.getId(), + item.getDescription(), + item.getOrderNo(), + item.getPrivilegeIds())) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/role/view/adapters/web/model/RoleBindingVO.java b/admin/src/main/java/app/module/admin/usecase/role/view/adapters/web/model/RoleBindingVO.java new file mode 100644 index 00000000..21dc209d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/role/view/adapters/web/model/RoleBindingVO.java @@ -0,0 +1,34 @@ +package app.module.admin.usecase.role.view.adapters.web.model; + +import app.module.core.config.application.converter.CustomLocalDateTimeSerializer; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import java.time.LocalDateTime; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class RoleBindingVO { + + private final String createdBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime createdAt; + + private final String updatedBy; + + @JsonSerialize(using = CustomLocalDateTimeSerializer.class) + @JsonDeserialize(using = LocalDateTimeDeserializer.class) + private final LocalDateTime updatedAt; + + private String id; + private String description; + private Integer orderNo; + private List privilegeIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/uicode/index/adapters/web/UICodeIndexController.java b/admin/src/main/java/app/module/admin/usecase/uicode/index/adapters/web/UICodeIndexController.java new file mode 100644 index 00000000..d5b44e91 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uicode/index/adapters/web/UICodeIndexController.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.uicode.index.adapters.web; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +@RequiredArgsConstructor +class UICodeIndexController { + + @GetMapping("/settings/uicode") + String process() { + return "uiCode/uiCodeList"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uicode/remove/adapters/web/UICodeRemoveController.java b/admin/src/main/java/app/module/admin/usecase/uicode/remove/adapters/web/UICodeRemoveController.java new file mode 100644 index 00000000..17dc2968 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uicode/remove/adapters/web/UICodeRemoveController.java @@ -0,0 +1,22 @@ +package app.module.admin.usecase.uicode.remove.adapters.web; + +import app.module.admin.usecase.uicode.save.adapters.web.UICodeSaveVO; +import app.module.core.usecase.uicode.remove.ports.UICodeRemovePortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class UICodeRemoveController { + + private final UICodeRemovePortIn uiCodeRemovePortIn; + + @PostMapping("/api/uicode/remove") + ResponseEntity process(UICodeSaveVO formDto) { + uiCodeRemovePortIn.operate(formDto.getId()); + return ResponseEntity.status(HttpStatus.OK).body(null); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uicode/save/adapters/web/UICodeSaveController.java b/admin/src/main/java/app/module/admin/usecase/uicode/save/adapters/web/UICodeSaveController.java new file mode 100644 index 00000000..f827c40b --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uicode/save/adapters/web/UICodeSaveController.java @@ -0,0 +1,51 @@ +package app.module.admin.usecase.uicode.save.adapters.web; + +import app.module.core.config.application.exception.AlreadyExistItemException; +import app.module.core.config.application.util.CoreUtil; +import app.module.core.usecase.uicode.save.ports.UICodeSavePortIn; +import app.module.core.usecase.uicode.save.ports.application.domain.UICodeSaveCommand; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class UICodeSaveController { + + private final UICodeSavePortIn createService; + private final CoreUtil coreUtil; + + @PostMapping("/api/uicode/save") + ResponseEntity process(@Valid @RequestBody UICodeSaveVO saveVO, + BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return coreUtil.getErrorInfo(bindingResult); + } + String savedId; + + try { + savedId = + createService.connect( + new UICodeSaveCommand( + saveVO.getId(), + saveVO.getParentId(), + saveVO.getOrderNo(), + saveVO.getCodeText(), + saveVO.getCodeValue(), + saveVO.getMsgCode(), + saveVO.getInUse()), + "create".equals(saveVO.getMode())); + + } catch (AlreadyExistItemException e) { + bindingResult.rejectValue("id", "", e.getMessage()); + return coreUtil.getErrorInfo(bindingResult); + } + + return ResponseEntity.status(HttpStatus.OK).body(savedId); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uicode/save/adapters/web/UICodeSaveVO.java b/admin/src/main/java/app/module/admin/usecase/uicode/save/adapters/web/UICodeSaveVO.java new file mode 100644 index 00000000..52524a94 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uicode/save/adapters/web/UICodeSaveVO.java @@ -0,0 +1,30 @@ +package app.module.admin.usecase.uicode.save.adapters.web; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.NonNull; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class UICodeSaveVO { + + @NotBlank(message = "{valid.common.required}") + @Pattern(regexp = "^.*[^\\\\.]$", message = "{valid.admin.id.notEndWith.dot}") + @NonNull + private String id; + private String parentId; + private Integer orderNo; + @NotBlank(message = "{valid.common.required}") + private String codeText; + @NotBlank(message = "{valid.common.required}") + private String codeValue; + private String msgCode; + private Boolean inUse; + private String mode; +} diff --git a/admin/src/main/java/app/module/admin/usecase/uicode/view/adapters/web/UICodeViewController.java b/admin/src/main/java/app/module/admin/usecase/uicode/view/adapters/web/UICodeViewController.java new file mode 100644 index 00000000..dba22cce --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uicode/view/adapters/web/UICodeViewController.java @@ -0,0 +1,31 @@ +package app.module.admin.usecase.uicode.view.adapters.web; + +import app.module.core.usecase.uicode.view.ports.UICodeViewPortIn; +import app.module.core.usecase.uicode.view.ports.application.domain.UICodeView; +import java.util.NoSuchElementException; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class UICodeViewController { + + private final UICodeViewPortIn uiCodeViewPortIn; + + @GetMapping("/api/uicode/{id}") + ResponseEntity process(@PathVariable String id) { + UICodeView item = + uiCodeViewPortIn + .connect(id) + .orElseThrow( + () -> + new NoSuchElementException( + String.format("'%s' - 존재하지 않는 UI Code 아이디 입니다.", id))); + + return ResponseEntity.status(HttpStatus.OK).body(item); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/index/adapter/web/URIIndexController.java b/admin/src/main/java/app/module/admin/usecase/uri/index/adapter/web/URIIndexController.java new file mode 100644 index 00000000..4966965e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/index/adapter/web/URIIndexController.java @@ -0,0 +1,30 @@ +package app.module.admin.usecase.uri.index.adapter.web; + +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.role.list.ports.RoleListPortIn; +import app.module.core.usecase.role.list.ports.application.domain.RoleElement; +import app.module.core.usecase.uicode.list.ports.UICodeListPortIn; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; + +@Controller +@RequiredArgsConstructor +@Slf4j +class URIIndexController { + + private final RoleListPortIn roleListPortIn; + private final UICodeListPortIn uiCodeListPortIn; + + @GetMapping(path = "/settings/uri/{appType}") + String intro(Model model, @PathVariable AppType appType) { + model.addAttribute("roles", roleListPortIn.connect(appType)); + model.addAttribute("appType", appType); + model.addAttribute("pageRows", uiCodeListPortIn.connect("code.pageable.rows")); + + return "uri/uriList"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/remove/adapter/web/URIRemoveController.java b/admin/src/main/java/app/module/admin/usecase/uri/remove/adapter/web/URIRemoveController.java new file mode 100644 index 00000000..0aee6f7d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/remove/adapter/web/URIRemoveController.java @@ -0,0 +1,44 @@ +package app.module.admin.usecase.uri.remove.adapter.web; + +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.exception.NonRemovableItemException; +import app.module.core.config.application.util.CoreUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.uri.remove.ports.URIRemovePortIn; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +public class URIRemoveController { + + private final CoreUtil coreUtil; + private final MessageUtil messageUtil; + private final URIRemovePortIn uriRemovePortIn; + + @PostMapping(path = "/api/uri/remove") + ResponseEntity remove(@Valid URIRemoveVO removeVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return coreUtil.getErrorInfo(bindingResult); + } + + try { + uriRemovePortIn.connect(AppType.ADMIN, removeVO.getId()); + } catch (NonRemovableItemException e) { + bindingResult.reject("", e.getMessage()); + return coreUtil.getErrorInfo(bindingResult); + } + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .message(messageUtil.getMessage("operation.common.remove.done")) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/remove/adapter/web/URIRemoveVO.java b/admin/src/main/java/app/module/admin/usecase/uri/remove/adapter/web/URIRemoveVO.java new file mode 100644 index 00000000..77a1cc07 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/remove/adapter/web/URIRemoveVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.uri.remove.adapter.web; + +import jakarta.validation.constraints.NotEmpty; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class URIRemoveVO { + + @NotEmpty(message = "{valid.common.required}") + private String id; +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/save/adapter/web/web/URISaveBindingVO.java b/admin/src/main/java/app/module/admin/usecase/uri/save/adapter/web/web/URISaveBindingVO.java new file mode 100644 index 00000000..c1217d68 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/save/adapter/web/web/URISaveBindingVO.java @@ -0,0 +1,47 @@ +package app.module.admin.usecase.uri.save.adapter.web.web; + +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.enums.SaveType; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.Pattern; +import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; +import org.springframework.web.multipart.MultipartFile; + +@Getter +@Setter +@AllArgsConstructor +public class URISaveBindingVO { + + private String id; + private AppType appType; + + @NotEmpty(message = "{valid.uri.text}") + private String text; + + @NotEmpty(message = "{valid.uri.uri}") + @Pattern(regexp = "^(/)|(/).+", message = "{valid.uri.must.startWith.slash}") + @Pattern(regexp = "^(/)|.*[^/]$", message = "{valid.uri.mustNot.endWith.slash}") + private String uri; + + private String type; + + @NotEmpty(message = "{valid.common.required}") + private String parentId; + + private Integer orderNo; + private boolean showOnNavi; + + private String ogTitle; + private String ogDesc; + private String ogKeywords; + private String ogImage; + + private MultipartFile ogImageFile; + + private Set roles; + + private SaveType saveType; +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/save/adapter/web/web/URISaveController.java b/admin/src/main/java/app/module/admin/usecase/uri/save/adapter/web/web/URISaveController.java new file mode 100644 index 00000000..3a9b0153 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/save/adapter/web/web/URISaveController.java @@ -0,0 +1,72 @@ +package app.module.admin.usecase.uri.save.adapter.web.web; + +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.enums.SaveType; +import app.module.core.config.application.exception.AlreadyExistItemException; +import app.module.core.config.application.exception.UnAcceptableFileException; +import app.module.core.config.application.util.CoreUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.uri.save.ports.URISavePortIn; +import app.module.core.usecase.uri.save.ports.application.domain.URISaveCommand; +import jakarta.validation.Valid; +import java.io.IOException; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +public class URISaveController { + + private final CoreUtil coreUtil; + private final URISavePortIn uriSavePortIn; + private final MessageUtil messageUtil; + + @PostMapping(path = "/api/uri/save") + public ResponseEntity save(@Valid URISaveBindingVO saveVO, BindingResult bindingResult) + throws IOException { + + if (bindingResult.hasErrors()) { + return coreUtil.getErrorInfo(bindingResult); + } + + String createdId; + try { + createdId = + uriSavePortIn.connect( + new URISaveCommand( + saveVO.getId(), + saveVO.getParentId(), + saveVO.getAppType(), + saveVO.getUri(), + saveVO.isShowOnNavi(), + saveVO.getText(), + saveVO.getOrderNo(), + saveVO.getOgTitle(), + saveVO.getOgDesc(), + saveVO.getOgKeywords(), + saveVO.getOgImage(), + saveVO.getRoles()), + saveVO.getOgImageFile(), + saveVO.getSaveType().equals(SaveType.CREATE)); + + } catch (UnAcceptableFileException e) { + bindingResult.rejectValue("ogImageFile", "", e.getMessage()); + return coreUtil.getErrorInfo(bindingResult); + + } catch (AlreadyExistItemException e) { + bindingResult.rejectValue("uri", "", new String[]{"URI"}, e.getMessage()); + return coreUtil.getErrorInfo(bindingResult); + } + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .item(createdId) + .message(messageUtil.getMessage("operation.common.save.done")) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/sort/adapter/web/URISortController.java b/admin/src/main/java/app/module/admin/usecase/uri/sort/adapter/web/URISortController.java new file mode 100644 index 00000000..73a54e56 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/sort/adapter/web/URISortController.java @@ -0,0 +1,38 @@ +package app.module.admin.usecase.uri.sort.adapter.web; + +import app.module.core.config.application.util.CoreUtil; +import app.module.core.usecase.uri.sort.ports.URISortPortIn; +import app.module.core.usecase.uri.sort.ports.application.domain.URISortCommand; +import jakarta.validation.Valid; +import java.util.List; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +public class URISortController { + + private final URISortPortIn uriSortPortIn; + private final CoreUtil coreUtil; + + @PostMapping(path = "/api/uri/switchOrderNo") + ResponseEntity switchOrderNo( + @Valid @RequestBody List sortVOs, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return coreUtil.getErrorInfo(bindingResult); + } + + uriSortPortIn.connect( + sortVOs.stream() + .map(item -> new URISortCommand(item.getId(), item.getOrderNo())) + .collect(Collectors.toList())); + + return ResponseEntity.status(HttpStatus.OK).body(null); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/sort/adapter/web/URISortVO.java b/admin/src/main/java/app/module/admin/usecase/uri/sort/adapter/web/URISortVO.java new file mode 100644 index 00000000..72f3043b --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/sort/adapter/web/URISortVO.java @@ -0,0 +1,19 @@ +package app.module.admin.usecase.uri.sort.adapter.web; + +import jakarta.validation.constraints.NotBlank; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class URISortVO { + + @NotBlank(message = "{valid.common.required}") + private String id; + + private Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/toptier/adapter/web/URITopTierController.java b/admin/src/main/java/app/module/admin/usecase/uri/toptier/adapter/web/URITopTierController.java new file mode 100644 index 00000000..87ae6f2e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/toptier/adapter/web/URITopTierController.java @@ -0,0 +1,37 @@ +package app.module.admin.usecase.uri.toptier.adapter.web; + +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.uri.toptier.ports.URITopTierPortIn; +import app.module.core.usecase.uri.toptier.ports.application.domain.URITopTier; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class URITopTierController { + + private final URITopTierPortIn topTierPortIn; + + @GetMapping(path = "/api/uri/topTier/{appType}") + ResponseEntity recursiveItems(@PathVariable AppType appType) { + URITopTier topTierOutput = topTierPortIn.connect(appType); + return ResponseEntity.status(HttpStatus.OK).body(recursiveMapping(topTierOutput)); + } + + private URITreeVO recursiveMapping(URITopTier output) { + return new URITreeVO( + output.getId(), + output.getText(), + output.getUri(), + output.getOrderNo(), + CollectionUtils.emptyIfNull(output.getChildren()).stream() + .map(this::recursiveMapping) + .collect(Collectors.toList())); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/toptier/adapter/web/URITreeVO.java b/admin/src/main/java/app/module/admin/usecase/uri/toptier/adapter/web/URITreeVO.java new file mode 100644 index 00000000..51584241 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/toptier/adapter/web/URITreeVO.java @@ -0,0 +1,18 @@ +package app.module.admin.usecase.uri.toptier.adapter.web; + +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class URITreeVO { + + private String id; + private String text; + private String uri; + private Integer orderNo; + private List nodes; +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/view/adapter/web/URIBindingVO.java b/admin/src/main/java/app/module/admin/usecase/uri/view/adapter/web/URIBindingVO.java new file mode 100644 index 00000000..ee8cb0f0 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/view/adapter/web/URIBindingVO.java @@ -0,0 +1,28 @@ +package app.module.admin.usecase.uri.view.adapter.web; + +import app.module.core.config.application.enums.AppType; +import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +public class URIBindingVO { + + private String id; + private AppType appType; + private String text; + private String uri; + private String parentId; + private Integer orderNo; + private boolean showOnNavi; + private String ogTitle; + private String ogDesc; + private String ogKeywords; + private String ogImage; + private Set roles; +} diff --git a/admin/src/main/java/app/module/admin/usecase/uri/view/adapter/web/URIViewController.java b/admin/src/main/java/app/module/admin/usecase/uri/view/adapter/web/URIViewController.java new file mode 100644 index 00000000..0da8cefb --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/uri/view/adapter/web/URIViewController.java @@ -0,0 +1,52 @@ +package app.module.admin.usecase.uri.view.adapter.web; + +import app.module.core.config.adapters.web.rest.response.RestResponse; +import app.module.core.config.application.enums.AppType; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.uri.view.ports.URIViewPortIn; +import app.module.core.usecase.uri.view.ports.application.domain.URIView; +import java.util.NoSuchElementException; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +public class URIViewController { + + private final MessageUtil messageUtil; + private final URIViewPortIn uriViewPortIn; + + @GetMapping(path = "/api/uri/{appType}/{id}") + ResponseEntity operate(@PathVariable AppType appType, @PathVariable String id) { + URIView output = + uriViewPortIn + .connect(appType, id) + .orElseThrow( + () -> + new NoSuchElementException( + messageUtil.getMessage("exception.noSuchElement", id, "URI"))); + + return ResponseEntity.status(HttpStatus.OK) + .body( + RestResponse.builder() + .item( + new URIBindingVO( + output.getId(), + output.getAppType(), + output.getText(), + output.getUri(), + output.getParentId(), + output.getOrderNo(), + output.getShowOnNavi(), + output.getOgTitle(), + output.getOgDesc(), + output.getOgKeywords(), + output.getOgImage(), + output.getRoles())) + .build()); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/getUser/adapters/web/GetUserController.java b/admin/src/main/java/app/module/admin/usecase/user/getUser/adapters/web/GetUserController.java new file mode 100644 index 00000000..6b55839d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/getUser/adapters/web/GetUserController.java @@ -0,0 +1,28 @@ +package app.module.admin.usecase.user.getUser.adapters.web; + +import app.module.core.usecase.user.findUser.ports.FindUserPortIn; +import app.module.core.usecase.user.findUser.ports.application.domain.FindUser; +import app.module.core.usecase.user.findUser.ports.application.domain.FindUserCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetUserController { + + private final FindUserPortIn findUserPortIn; + + @GetMapping(path = "/api/settings/users/{id}") + ResponseEntity operate(@PathVariable String id) { + FindUser findUser = findUserPortIn.operate(new FindUserCmd(id)).orElseThrow(); + + // 불필요한 정보는 제거 + findUser.setPassword(null); + + return ResponseEntity.status(HttpStatus.OK).body(findUser); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/getUserUpdateUI/adapters/web/GetUserUpdateUIController.java b/admin/src/main/java/app/module/admin/usecase/user/getUserUpdateUI/adapters/web/GetUserUpdateUIController.java new file mode 100644 index 00000000..c579a0ed --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/getUserUpdateUI/adapters/web/GetUserUpdateUIController.java @@ -0,0 +1,30 @@ +package app.module.admin.usecase.user.getUserUpdateUI.adapters.web; + +import app.module.core.usecase.user.getRoles.ports.GetRolesPortIn; +import app.module.core.usecase.user.getRoles.ports.application.domain.GetRolesCmd; +import app.module.admin.usecase.user.getUserUpdateUI.adapters.web.model.GetUserUpdateUIReqVO; +import app.module.core.config.application.enums.AppType; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.PathVariable; + +@Controller +@RequiredArgsConstructor +class GetUserUpdateUIController { + + private final GetRolesPortIn getRolesPortIn; + + @GetMapping(path = "/settings/users/{id}") + String operate( + Model model, + @PathVariable @ModelAttribute("id") String id, + @ModelAttribute("reqVO") GetUserUpdateUIReqVO reqVO) { + + model.addAttribute("roles", getRolesPortIn.operate(new GetRolesCmd(AppType.FRONT))); + + return "settings/users/{id}"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/getUserUpdateUI/adapters/web/model/GetUserUpdateUIReqVO.java b/admin/src/main/java/app/module/admin/usecase/user/getUserUpdateUI/adapters/web/model/GetUserUpdateUIReqVO.java new file mode 100644 index 00000000..8065d5d8 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/getUserUpdateUI/adapters/web/model/GetUserUpdateUIReqVO.java @@ -0,0 +1,14 @@ +package app.module.admin.usecase.user.getUserUpdateUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUserUpdateUIReqVO { + +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/getUsers/adapters/web/GetUsersController.java b/admin/src/main/java/app/module/admin/usecase/user/getUsers/adapters/web/GetUsersController.java new file mode 100644 index 00000000..66f1664d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/getUsers/adapters/web/GetUsersController.java @@ -0,0 +1,32 @@ +package app.module.admin.usecase.user.getUsers.adapters.web; + +import app.module.admin.usecase.user.getUsers.adapters.web.model.GetUsersReqVO; +import app.module.core.usecase.user.getUsers.ports.GetUsersPortIn; +import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsers; +import app.module.core.usecase.user.getUsers.ports.application.domain.GetUsersCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.web.PageableDefault; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetUsersController { + + private final GetUsersPortIn getUsersPortIn; + + @GetMapping(path = "/api/settings/users") + ResponseEntity operate(@PageableDefault Pageable pageable, GetUsersReqVO reqVO) { + Page users = + getUsersPortIn.operate( + pageable, + new GetUsersCmd(reqVO.getSearchField(), reqVO.getSearchValue(), + reqVO.getSearchRole())); + + return ResponseEntity.status(HttpStatus.OK).body(users); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/getUsers/adapters/web/model/GetUsersReqVO.java b/admin/src/main/java/app/module/admin/usecase/user/getUsers/adapters/web/model/GetUsersReqVO.java new file mode 100644 index 00000000..a9753559 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/getUsers/adapters/web/model/GetUsersReqVO.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.user.getUsers.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUsersReqVO { + + private final String searchField; + private final String searchValue; + private final String searchRole; +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/getUsersUI/adapters/web/GetUsersUIController.java b/admin/src/main/java/app/module/admin/usecase/user/getUsersUI/adapters/web/GetUsersUIController.java new file mode 100644 index 00000000..5e920261 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/getUsersUI/adapters/web/GetUsersUIController.java @@ -0,0 +1,29 @@ +package app.module.admin.usecase.user.getUsersUI.adapters.web; + +import app.module.core.usecase.user.getRoles.ports.GetRolesPortIn; +import app.module.core.usecase.user.getRoles.ports.application.domain.GetRolesCmd; +import app.module.admin.usecase.user.getUsersUI.adapters.web.model.GetUsersUIReqVO; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.uicode.list.ports.UICodeListPortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +class GetUsersUIController { + + private final UICodeListPortIn uiCodeListPortIn; + private final GetRolesPortIn getRolesPortIn; + + @GetMapping(path = "/settings/users") + String operate(Model model, @ModelAttribute("reqVO") GetUsersUIReqVO reqVO) { + + model.addAttribute("pageRows", uiCodeListPortIn.connect("code.pageable.rows")); + model.addAttribute("roles", getRolesPortIn.operate(new GetRolesCmd(AppType.FRONT))); + + return "settings/users"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/getUsersUI/adapters/web/model/GetUsersUIReqVO.java b/admin/src/main/java/app/module/admin/usecase/user/getUsersUI/adapters/web/model/GetUsersUIReqVO.java new file mode 100644 index 00000000..aedcab26 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/getUsersUI/adapters/web/model/GetUsersUIReqVO.java @@ -0,0 +1,36 @@ +package app.module.admin.usecase.user.getUsersUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; +import org.thymeleaf.util.StringUtils; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUsersUIReqVO { + + private final String searchField; + private final String searchValue; + private final String searchRole; + private Integer page; + private String sort; + private Integer size; + + public Integer getPage() { + // 요청 페이지 넘버 - 초기값 `0` + return page != null ? page : 0; + } + + public String getSort() { + // 정렬 값 - 초기값 `createdAt 내림차순` + return StringUtils.isEmpty(sort) ? "createdAt,DESC" : sort; + } + + public Integer getSize() { + // 페이지 당 아이템 수 - 초기값 `10` + return size != null ? size : 10; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/updateUser/adapters/web/UpdateUserController.java b/admin/src/main/java/app/module/admin/usecase/user/updateUser/adapters/web/UpdateUserController.java new file mode 100644 index 00000000..d915b51b --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/updateUser/adapters/web/UpdateUserController.java @@ -0,0 +1,39 @@ +package app.module.admin.usecase.user.updateUser.adapters.web; + +import app.module.admin.usecase.user.updateUser.adapters.web.model.UpdateUserReqVO; +import app.module.core.usecase.user.updateUserByAdmin.ports.UpdateUserPortIn; +import app.module.core.usecase.user.updateUserByAdmin.ports.application.domain.UpdateUserCmd; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class UpdateUserController { + + private final UpdateUserPortIn updateUserPortIn; + + @PatchMapping(path = "/api/settings/users/update") + ResponseEntity operate(@Valid UpdateUserReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + updateUserPortIn.operate( + new UpdateUserCmd( + reqVO.getId(), + reqVO.getEmail(), + reqVO.getNickname(), + reqVO.getAccountDisabled(), + reqVO.getLoginFailCnt(), + reqVO.getAccountLocked(), + reqVO.getRoles())); + + return ResponseEntity.status(HttpStatus.OK).body(reqVO); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/user/updateUser/adapters/web/model/UpdateUserReqVO.java b/admin/src/main/java/app/module/admin/usecase/user/updateUser/adapters/web/model/UpdateUserReqVO.java new file mode 100644 index 00000000..7be1c241 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/user/updateUser/adapters/web/model/UpdateUserReqVO.java @@ -0,0 +1,45 @@ +package app.module.admin.usecase.user.updateUser.adapters.web.model; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.NotEmpty; +import jakarta.validation.constraints.NotNull; +import jakarta.validation.constraints.Pattern; +import java.util.Set; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class UpdateUserReqVO { + + @NotNull(message = "{valid.common.required}") + private String id; + + @NotBlank(message = "{valid.common.required}") + @Pattern( + regexp = + "^[\\w!#$%&’*+/=?`{|}~^-]+(?:\\.[\\w!#$%&’*+/=?`{|}~^-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,6}$", + message = "{valid.common.email.wrong}") + private String email; + + // TODO : 닉네임은 프론트 쪽에만 사용되는 항목인지 체크하기(임시 주석처리) +// @NotBlank(message = "{valid.common.required}") + @Pattern(regexp = "^[가-힣a-zA-Z0-9_-]{2,10}$", message = "{valid.common.nickname.wrong}") + private String nickname; + + @NotNull(message = "{valid.common.required}") + private Boolean accountDisabled; + + @NotNull(message = "{valid.common.required}") + private Integer loginFailCnt; + + @NotNull(message = "{valid.common.required}") + private Boolean accountLocked; + + @NotEmpty(message = "{valid.common.required}") + private Set roles; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilege/adapters/web/GetUserPrivilegeController.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilege/adapters/web/GetUserPrivilegeController.java new file mode 100644 index 00000000..049bf461 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilege/adapters/web/GetUserPrivilegeController.java @@ -0,0 +1,27 @@ +package app.module.admin.usecase.userPrivilege.getUserPrivilege.adapters.web; + +import app.module.admin.usecase.userPrivilege.getUserPrivilege.adapters.web.model.GetUserPrivilegeResVO; +import app.module.core.usecase.userPrivilege.getUserPrivilege.ports.GetUserPrivilegePortIn; +import app.module.core.usecase.userPrivilege.getUserPrivilege.ports.application.domain.GetUserPrivilege; +import app.module.core.usecase.userPrivilege.getUserPrivilege.ports.application.domain.GetUserPrivilegeCmd; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetUserPrivilegeController { + + private final GetUserPrivilegePortIn getUserPrivilegePortIn; + + @GetMapping(path = "/api/userPrivileges/{id}") + ResponseEntity operate(@PathVariable String id) { + GetUserPrivilege userPrivilege = + getUserPrivilegePortIn.operate(new GetUserPrivilegeCmd(id)).orElse(null); + + return ResponseEntity.status(HttpStatus.OK).body(new GetUserPrivilegeResVO(userPrivilege)); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilege/adapters/web/model/GetUserPrivilegeResVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilege/adapters/web/model/GetUserPrivilegeResVO.java new file mode 100644 index 00000000..6b78cbcc --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilege/adapters/web/model/GetUserPrivilegeResVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.userPrivilege.getUserPrivilege.adapters.web.model; + +import app.module.core.usecase.userPrivilege.getUserPrivilege.ports.application.domain.GetUserPrivilege; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUserPrivilegeResVO { + + private GetUserPrivilege userPrivilege; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivileges/adapters/web/GetUserPrivilegesController.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivileges/adapters/web/GetUserPrivilegesController.java new file mode 100644 index 00000000..96ee2fe7 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivileges/adapters/web/GetUserPrivilegesController.java @@ -0,0 +1,24 @@ +package app.module.admin.usecase.userPrivilege.getUserPrivileges.adapters.web; + +import app.module.admin.usecase.userPrivilege.getUserPrivileges.adapters.web.model.GetUserPrivilegesResVO; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.userPrivilege.getUserPrivileges.ports.GetUserPrivilegesPortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetUserPrivilegesController { + + private final GetUserPrivilegesPortIn getUserPrivilegesPortIn; + + @GetMapping(path = "/api/userPrivileges") + ResponseEntity operate() { + + return ResponseEntity.status(HttpStatus.OK) + .body(new GetUserPrivilegesResVO(getUserPrivilegesPortIn.operate(AppType.FRONT))); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivileges/adapters/web/model/GetUserPrivilegesResVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivileges/adapters/web/model/GetUserPrivilegesResVO.java new file mode 100644 index 00000000..48adbd1d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivileges/adapters/web/model/GetUserPrivilegesResVO.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.userPrivilege.getUserPrivileges.adapters.web.model; + +import app.module.core.usecase.userPrivilege.getUserPrivileges.ports.application.domain.GetUserPrivileges; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUserPrivilegesResVO { + + private List userPrivileges; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilegesUI/adapters/web/GetUserPrivilegeUIController.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilegesUI/adapters/web/GetUserPrivilegeUIController.java new file mode 100644 index 00000000..0ba513f8 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/getUserPrivilegesUI/adapters/web/GetUserPrivilegeUIController.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.userPrivilege.getUserPrivilegesUI.adapters.web; + +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; + +@Controller +@RequiredArgsConstructor +class GetUserPrivilegeUIController { + + @GetMapping(path = "/settings/userPrivilege") + String operate() { + return "settings/userPrivilege"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/RemoveUserPrivilegeController.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/RemoveUserPrivilegeController.java new file mode 100644 index 00000000..f5b19d46 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/RemoveUserPrivilegeController.java @@ -0,0 +1,36 @@ +package app.module.admin.usecase.userPrivilege.removeUserPrivilege.adapters.web; + +import app.module.admin.usecase.userPrivilege.removeUserPrivilege.adapters.web.model.RemoveUserPrivilegeReqVO; +import app.module.admin.usecase.userPrivilege.removeUserPrivilege.adapters.web.model.RemoveUserPrivilegeResVO; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.userPrivilege.removeUserPrivilege.ports.RemoveUserPrivilegePortIn; +import app.module.core.usecase.userPrivilege.removeUserPrivilege.ports.application.domain.RemoveUserPrivilegeCmd; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RemoveUserPrivilegeController { + + private final RemoveUserPrivilegePortIn removeUserPrivilegePortIn; + private final MessageUtil messageUtil; + + @DeleteMapping(path = "/api/userPrivileges/remove") + ResponseEntity operate(@Valid RemoveUserPrivilegeReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + removeUserPrivilegePortIn.operate(new RemoveUserPrivilegeCmd(reqVO.getId())); + + return ResponseEntity.status(HttpStatus.OK) + .body(new RemoveUserPrivilegeResVO( + messageUtil.getMessage("operation.common.remove.done"))); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/model/RemoveUserPrivilegeReqVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/model/RemoveUserPrivilegeReqVO.java new file mode 100644 index 00000000..54cce931 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/model/RemoveUserPrivilegeReqVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.userPrivilege.removeUserPrivilege.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class RemoveUserPrivilegeReqVO { + + private String id; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/model/RemoveUserPrivilegeResVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/model/RemoveUserPrivilegeResVO.java new file mode 100644 index 00000000..9039c8a1 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/removeUserPrivilege/adapters/web/model/RemoveUserPrivilegeResVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.userPrivilege.removeUserPrivilege.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class RemoveUserPrivilegeResVO { + + private String msg; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/SaveUserPrivilegeController.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/SaveUserPrivilegeController.java new file mode 100644 index 00000000..88b900c3 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/SaveUserPrivilegeController.java @@ -0,0 +1,43 @@ +package app.module.admin.usecase.userPrivilege.saveUserPrivilege.adapters.web; + +import app.module.admin.usecase.userPrivilege.saveUserPrivilege.adapters.web.model.SaveUserPrivilegeReqVO; +import app.module.admin.usecase.userPrivilege.saveUserPrivilege.adapters.web.model.SaveUserPrivilegeResVO; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.userPrivilege.saveUserPrivilege.ports.SaveUserPrivilegePortIn; +import app.module.core.usecase.userPrivilege.saveUserPrivilege.ports.application.domain.SaveUserPrivilege; +import app.module.core.usecase.userPrivilege.saveUserPrivilege.ports.application.domain.SaveUserPrivilegeCmd; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class SaveUserPrivilegeController { + + private final SaveUserPrivilegePortIn saveUserPrivilegePortIn; + private final MessageUtil messageUtil; + + @PostMapping(path = "/api/userPrivileges/save") + ResponseEntity operate(@Valid SaveUserPrivilegeReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + SaveUserPrivilege userPrivilege = + saveUserPrivilegePortIn + .operate( + new SaveUserPrivilegeCmd(reqVO.getId(), reqVO.getDescription(), + reqVO.getOrderNo())) + .orElse(null); + + return ResponseEntity.status(HttpStatus.OK) + .body( + new SaveUserPrivilegeResVO( + userPrivilege, messageUtil.getMessage("operation.common.save.done"))); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/model/SaveUserPrivilegeReqVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/model/SaveUserPrivilegeReqVO.java new file mode 100644 index 00000000..20de030e --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/model/SaveUserPrivilegeReqVO.java @@ -0,0 +1,19 @@ +package app.module.admin.usecase.userPrivilege.saveUserPrivilege.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class SaveUserPrivilegeReqVO { + + private String id; + private String description; + private Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/model/SaveUserPrivilegeResVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/model/SaveUserPrivilegeResVO.java new file mode 100644 index 00000000..861b05a9 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/saveUserPrivilege/adapters/web/model/SaveUserPrivilegeResVO.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.userPrivilege.saveUserPrivilege.adapters.web.model; + +import app.module.core.usecase.userPrivilege.saveUserPrivilege.ports.application.domain.SaveUserPrivilege; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class SaveUserPrivilegeResVO { + + private SaveUserPrivilege userPrivilege; + private String msg; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/SortUserPrivilegeController.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/SortUserPrivilegeController.java new file mode 100644 index 00000000..92e9c719 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/SortUserPrivilegeController.java @@ -0,0 +1,40 @@ +package app.module.admin.usecase.userPrivilege.sortUserPrivilege.adapters.web; + +import app.module.admin.usecase.userPrivilege.sortUserPrivilege.adapters.web.model.SortUserPrivilegeReqVO; +import app.module.admin.usecase.userPrivilege.sortUserPrivilege.adapters.web.model.SortUserPrivilegeResVO; +import app.module.core.usecase.userPrivilege.sortUserPrivilege.ports.SortUserPrivilegePortIn; +import app.module.core.usecase.userPrivilege.sortUserPrivilege.ports.application.domain.SortUserPrivilegeCmd; +import app.module.core.usecase.userPrivilege.sortUserPrivilege.ports.application.domain.SortUserPrivilegeDTO; +import jakarta.validation.Valid; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class SortUserPrivilegeController { + + private final SortUserPrivilegePortIn sortUserPrivilegePortIn; + + @PatchMapping(path = "/api/userPrivileges/sort") + ResponseEntity operate( + @Valid @RequestBody SortUserPrivilegeReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + sortUserPrivilegePortIn.operate( + new SortUserPrivilegeCmd( + reqVO.getSortUserPrivileges().stream() + .map(vo -> new SortUserPrivilegeDTO(vo.getId(), vo.getOrderNo())) + .collect(Collectors.toList()))); + + return ResponseEntity.status(HttpStatus.OK).body(new SortUserPrivilegeResVO(true)); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeReqVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeReqVO.java new file mode 100644 index 00000000..9c9dc4fd --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeReqVO.java @@ -0,0 +1,18 @@ +package app.module.admin.usecase.userPrivilege.sortUserPrivilege.adapters.web.model; + +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class SortUserPrivilegeReqVO { + + private List sortUserPrivileges; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeResVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeResVO.java new file mode 100644 index 00000000..4ae90689 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeResVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.userPrivilege.sortUserPrivilege.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class SortUserPrivilegeResVO { + + private boolean sorted; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeVO.java b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeVO.java new file mode 100644 index 00000000..c84cc198 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userPrivilege/sortUserPrivilege/adapters/web/model/SortUserPrivilegeVO.java @@ -0,0 +1,18 @@ +package app.module.admin.usecase.userPrivilege.sortUserPrivilege.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class SortUserPrivilegeVO { + + private String id; + private Integer orderNo; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRole/adapters/web/GetUserRoleController.java b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRole/adapters/web/GetUserRoleController.java new file mode 100644 index 00000000..798a1680 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRole/adapters/web/GetUserRoleController.java @@ -0,0 +1,27 @@ +package app.module.admin.usecase.userRole.GetUserRole.adapters.web; + +import app.module.admin.usecase.userRole.SaveUserRole.adapters.web.model.model.GetUserRoleResVO; +import app.module.core.usecase.userRole.getUserRole.ports.GetUserRolePortIn; +import app.module.core.usecase.userRole.getUserRole.ports.application.domain.GetUserRole; +import app.module.core.usecase.userRole.getUserRole.ports.application.domain.GetUserRoleCmd; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetUserRoleController { + + private final GetUserRolePortIn getUserRolePortIn; + + @GetMapping(path = "/api/userRoles/{id}") + ResponseEntity operate(@PathVariable String id) { + Optional userRole = getUserRolePortIn.operate(new GetUserRoleCmd(id)); + return ResponseEntity.status(HttpStatus.OK) + .body(new GetUserRoleResVO(userRole.orElse(null))); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/GetUserRolesController.java b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/GetUserRolesController.java new file mode 100644 index 00000000..78100159 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/GetUserRolesController.java @@ -0,0 +1,38 @@ +package app.module.admin.usecase.userRole.GetUserRoles.adapters.web; + +import app.module.admin.usecase.userRole.GetUserRoles.adapters.web.model.GetUserRolesResVO; +import app.module.admin.usecase.userRole.GetUserRoles.adapters.web.model.GetUserRolesVO; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.userRole.getUserRoles.ports.GetUserRolesPortIn; +import app.module.core.usecase.userRole.getUserRoles.ports.application.domain.GetUserPrivileges; +import java.util.List; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class GetUserRolesController { + + private final GetUserRolesPortIn getUserRolesPortIn; + + @GetMapping(path = "/api/userRoles") + ResponseEntity operate() { + List userRoles = + getUserRolesPortIn.operate(AppType.FRONT).stream() + .map( + getUserRoles -> + new GetUserRolesVO( + getUserRoles.getId(), + getUserRoles.getDescription(), + getUserRoles.getOrderNo(), + getUserRoles.getPrivileges().stream() + .map(GetUserPrivileges::getId) + .toList())) + .toList(); + + return ResponseEntity.status(HttpStatus.OK).body(new GetUserRolesResVO(userRoles)); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/model/GetUserRolesResVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/model/GetUserRolesResVO.java new file mode 100644 index 00000000..1fedd708 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/model/GetUserRolesResVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.userRole.GetUserRoles.adapters.web.model; + +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUserRolesResVO { + + private List userRoles; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/model/GetUserRolesVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/model/GetUserRolesVO.java new file mode 100644 index 00000000..ec43168f --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRoles/adapters/web/model/GetUserRolesVO.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.userRole.GetUserRoles.adapters.web.model; + +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +public class GetUserRolesVO { + + private String id; + private String description; + private Integer orderNo; + private List privilegeIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRolesUI/adapters/web/GetUserRolesUIController.java b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRolesUI/adapters/web/GetUserRolesUIController.java new file mode 100644 index 00000000..16fe58dc --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRolesUI/adapters/web/GetUserRolesUIController.java @@ -0,0 +1,23 @@ +package app.module.admin.usecase.userRole.GetUserRolesUI.adapters.web; + +import app.module.admin.usecase.userRole.GetUserRolesUI.adapters.web.model.GetUserRolesUIReqVO; +import app.module.core.config.application.enums.AppType; +import app.module.core.usecase.userPrivilege.getUserPrivileges.ports.GetUserPrivilegesPortIn; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ModelAttribute; + +@Controller +@RequiredArgsConstructor +class GetUserRolesUIController { + + private final GetUserPrivilegesPortIn getUserPrivilegesPortIn; + + @GetMapping(path = "/settings/userRoles") + String operate(Model model, @ModelAttribute("reqVO") GetUserRolesUIReqVO reqVO) { + model.addAttribute("privileges", getUserPrivilegesPortIn.operate(AppType.FRONT)); + return "settings/userRoles"; + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRolesUI/adapters/web/model/GetUserRolesUIReqVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRolesUI/adapters/web/model/GetUserRolesUIReqVO.java new file mode 100644 index 00000000..e4f503e4 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/GetUserRolesUI/adapters/web/model/GetUserRolesUIReqVO.java @@ -0,0 +1,14 @@ +package app.module.admin.usecase.userRole.GetUserRolesUI.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUserRolesUIReqVO { + +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/SaveUserRoleController.java b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/SaveUserRoleController.java new file mode 100644 index 00000000..d3dbe682 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/SaveUserRoleController.java @@ -0,0 +1,46 @@ +package app.module.admin.usecase.userRole.SaveUserRole.adapters.web; + +import app.module.admin.usecase.userRole.SaveUserRole.adapters.web.model.SaveUserRoleReqVO; +import app.module.admin.usecase.userRole.SaveUserRole.adapters.web.model.SaveUserRoleResVO; +import app.module.core.config.application.util.CoreUtil; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.userRole.saveUserRole.ports.SaveUserRolePortIn; +import app.module.core.usecase.userRole.saveUserRole.ports.application.domain.SaveUserRole; +import app.module.core.usecase.userRole.saveUserRole.ports.application.domain.SaveUserRoleCmd; +import jakarta.validation.Valid; +import java.util.Optional; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class SaveUserRoleController { + + private final CoreUtil coreUtil; + private final MessageUtil messageUtil; + private final SaveUserRolePortIn saveUserRolePortIn; + + @PostMapping(path = "/api/userRoles/save") + ResponseEntity operate(@Valid SaveUserRoleReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return coreUtil.getErrorInfo(bindingResult); + } + + Optional role = + saveUserRolePortIn.operate( + new SaveUserRoleCmd( + reqVO.getId(), + reqVO.getDescription(), + reqVO.getOrderNo(), + reqVO.getPrivilegeIds())); + + String id = role.map(SaveUserRole::getId).orElse(null); + + return ResponseEntity.status(HttpStatus.OK) + .body(new SaveUserRoleResVO(id, messageUtil.getMessage("operation.common.save.done"))); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/SaveUserRoleReqVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/SaveUserRoleReqVO.java new file mode 100644 index 00000000..45142cf3 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/SaveUserRoleReqVO.java @@ -0,0 +1,28 @@ +package app.module.admin.usecase.userRole.SaveUserRole.adapters.web.model; + +import jakarta.validation.constraints.NotBlank; +import jakarta.validation.constraints.Pattern; +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class SaveUserRoleReqVO { + + @NotBlank(message = "{valid.common.required}") + @Pattern(regexp = "^(ROLE_).+", message = "{valid.adminRole.id.mustStartWith.role}") + private String id; + + @NotBlank(message = "{valid.common.required}") + private String description; + + private Integer orderNo; + private List privilegeIds; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/SaveUserRoleResVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/SaveUserRoleResVO.java new file mode 100644 index 00000000..585052a8 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/SaveUserRoleResVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.userRole.SaveUserRole.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class SaveUserRoleResVO { + + private String id; + private String msg; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/model/GetUserRoleResVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/model/GetUserRoleResVO.java new file mode 100644 index 00000000..2bdce332 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/SaveUserRole/adapters/web/model/model/GetUserRoleResVO.java @@ -0,0 +1,16 @@ +package app.module.admin.usecase.userRole.SaveUserRole.adapters.web.model.model; + +import app.module.core.usecase.userRole.getUserRole.ports.application.domain.GetUserRole; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class GetUserRoleResVO { + + private GetUserRole userRole; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/RemoveUserRoleController.java b/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/RemoveUserRoleController.java new file mode 100644 index 00000000..815e2e16 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/RemoveUserRoleController.java @@ -0,0 +1,35 @@ +package app.module.admin.usecase.userRole.removeUserRole.adapters.web; + +import app.module.admin.usecase.userRole.removeUserRole.adapters.web.model.RemoveUserRoleReqVO; +import app.module.admin.usecase.userRole.removeUserRole.adapters.web.model.RemoveUserRoleResVO; +import app.module.core.config.application.util.MessageUtil; +import app.module.core.usecase.userRole.removeUserRole.ports.RemoveUserRolePortIn; +import app.module.core.usecase.userRole.removeUserRole.ports.application.domain.RemoveUserRoleCmd; +import jakarta.validation.Valid; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class RemoveUserRoleController { + + private final RemoveUserRolePortIn removeUserRolePortIn; + private final MessageUtil messageUtil; + + @DeleteMapping(path = "/api/userRole/remove") + ResponseEntity operate(@Valid RemoveUserRoleReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + removeUserRolePortIn.operate(new RemoveUserRoleCmd(reqVO.getId())); + + return ResponseEntity.status(HttpStatus.OK) + .body(new RemoveUserRoleResVO(messageUtil.getMessage("operation.common.remove.done"))); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/model/RemoveUserRoleReqVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/model/RemoveUserRoleReqVO.java new file mode 100644 index 00000000..fd922776 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/model/RemoveUserRoleReqVO.java @@ -0,0 +1,17 @@ +package app.module.admin.usecase.userRole.removeUserRole.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class RemoveUserRoleReqVO { + + private String id; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/model/RemoveUserRoleResVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/model/RemoveUserRoleResVO.java new file mode 100644 index 00000000..44e34d01 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/removeUserRole/adapters/web/model/RemoveUserRoleResVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.userRole.removeUserRole.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class RemoveUserRoleResVO { + + private String msg; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/SortUserRoleController.java b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/SortUserRoleController.java new file mode 100644 index 00000000..bc17324d --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/SortUserRoleController.java @@ -0,0 +1,43 @@ +package app.module.admin.usecase.userRole.sortUserRole.adapters.web; + +import app.module.admin.usecase.userRole.sortUserRole.adapters.web.model.SortUserRoleReqVO; +import app.module.admin.usecase.userRole.sortUserRole.adapters.web.model.SortUserRoleResVO; +import app.module.core.usecase.userRole.sortUserRole.ports.SortUserRolePortIn; +import app.module.core.usecase.userRole.sortUserRole.ports.application.domain.SortUserRoleCmd; +import app.module.core.usecase.userRole.sortUserRole.ports.application.domain.SortUserRoleDTO; +import jakarta.validation.Valid; +import java.util.stream.Collectors; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequiredArgsConstructor +class SortUserRoleController { + + private final SortUserRolePortIn sortUserRolePortIn; + + @PatchMapping(path = "/api/userRoles/sort") + ResponseEntity operate( + @Valid @RequestBody SortUserRoleReqVO reqVO, BindingResult bindingResult) { + if (bindingResult.hasErrors()) { + return ResponseEntity.status(HttpStatus.UNPROCESSABLE_ENTITY) + .body(bindingResult.getFieldErrors()); + } + + sortUserRolePortIn.operate( + new SortUserRoleCmd( + reqVO.getSortUserRoles().stream() + .map( + sortUserRoleVO -> + new SortUserRoleDTO(sortUserRoleVO.getId(), + sortUserRoleVO.getOrderNo())) + .collect(Collectors.toList()))); + + return ResponseEntity.status(HttpStatus.OK).body(new SortUserRoleResVO(true)); + } +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleReqVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleReqVO.java new file mode 100644 index 00000000..e7ca3479 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleReqVO.java @@ -0,0 +1,18 @@ +package app.module.admin.usecase.userRole.sortUserRole.adapters.web.model; + +import java.util.List; +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class SortUserRoleReqVO { + + private List sortUserRoles; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleResVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleResVO.java new file mode 100644 index 00000000..cd279e7f --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleResVO.java @@ -0,0 +1,15 @@ +package app.module.admin.usecase.userRole.sortUserRole.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@AllArgsConstructor +@EqualsAndHashCode +public class SortUserRoleResVO { + + private boolean sorted; +} diff --git a/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleVO.java b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleVO.java new file mode 100644 index 00000000..eca61c31 --- /dev/null +++ b/admin/src/main/java/app/module/admin/usecase/userRole/sortUserRole/adapters/web/model/SortUserRoleVO.java @@ -0,0 +1,18 @@ +package app.module.admin.usecase.userRole.sortUserRole.adapters.web.model; + +import lombok.AllArgsConstructor; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; + +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode +public class SortUserRoleVO { + + private String id; + private Integer orderNo; +} diff --git a/admin/src/main/resources/application-dev.yml b/admin/src/main/resources/application-dev.yml new file mode 100644 index 00000000..4226cc80 --- /dev/null +++ b/admin/src/main/resources/application-dev.yml @@ -0,0 +1,26 @@ +# ============================================== +# 애플리케이션 로깅 설정 +# ============================================== +logging: + file: + # 로그 파일 저장 경로 (사용자 홈 디렉토리 내 logs 폴더) + # ${user.home}은 시스템 사용자 홈 디렉토리를 가리킵니다 + path: ${user.home}/logs + + level: + # 애플리케이션 기본 패키지 로깅 레벨 설정 (DEBUG로 설정됨) + # 중요: 실제 애플리케이션 기본 패키지 경로로 변경해야 정상 작동합니다 + app.module: DEBUG + + # Spring 프레임워크 코어 로깅 레벨 (INFO 로 설정) + org.springframework: INFO + +# ============================================== +# 메시지 및 국제화(i18n) 설정 +# ============================================== +spring: + messages: + # 메시지 소스 캐시 지속 시간(초) + # 4초마다 메시지 파일을 다시 읽어옵니다 + # 개발 시에는 짧은 간격으로, 운영 시에는 길게 설정하는 것이 일반적 + cache-duration: 10s \ No newline at end of file diff --git a/admin/src/main/resources/application-local.yml b/admin/src/main/resources/application-local.yml new file mode 100644 index 00000000..567af0ca --- /dev/null +++ b/admin/src/main/resources/application-local.yml @@ -0,0 +1,26 @@ +# ============================================== +# 애플리케이션 로깅 설정 +# ============================================== +logging: + file: + # 로그 파일 저장 경로 (시스템 사용자 홈 디렉토리 하위 logs 폴더) + path: ${user.home}/logs + level: + # 애플리케이션 기본 패키지 로깅 레벨 (INFO 로 설정) + # 주의: 기본 패키지 변경 시 app.module 부분을 반드시 수정해야 애플리케이션 로그가 출력됨 + app.module: INFO + # Spring 프레임워크 로깅 레벨 + org.springframework: INFO + # Spring Security 로깅 레벨 + org.springframework.security: INFO + +# ============================================== +# 메시지 및 다국어 처리 설정 +# ============================================== +spring: + messages: + # 메시지 캐시 지속 시간(초) + cache-duration: 10s + thymeleaf: + # 타임리프 템플릿 캐시 비활성화 (개발 환경에서는 false 로 설정 권장) + cache: false \ No newline at end of file diff --git a/admin/src/main/resources/application-prod.yml b/admin/src/main/resources/application-prod.yml new file mode 100644 index 00000000..eb1542b0 --- /dev/null +++ b/admin/src/main/resources/application-prod.yml @@ -0,0 +1,25 @@ +# ============================================== +# 애플리케이션 로깅 설정 +# ============================================== +logging: + file: + # 로그 파일 저장 위치 (사용자 홈 디렉토리 내 logs 폴더) + # ${user.home}은 시스템의 사용자 홈 디렉토리를 참조합니다 + path: ${user.home}/logs + + level: + # 애플리케이션 기본 패키지 로깅 레벨 (INFO 레벨로 설정) + # 주의: 실제 애플리케이션의 기본 패키지 경로로 변경해야 합니다 + app.module: INFO + + # Spring Framework 코어 모듈 로깅 레벨 (INFO 레벨로 설정) + org.springframework: INFO + +# ============================================== +# 메시지 및 국제화(i18n) 설정 +# ============================================== +spring: + messages: + # 메시지 소스 캐시 지속 시간 (단위: 초) + # 개발 환경에서는 짧은 간격(10-60초), 운영 환경에서는 긴 간격(3600초 이상) 권장 + cache-duration: 5m \ No newline at end of file diff --git a/admin/src/main/resources/application.yml b/admin/src/main/resources/application.yml new file mode 100644 index 00000000..33e8a7d7 --- /dev/null +++ b/admin/src/main/resources/application.yml @@ -0,0 +1,102 @@ +# ============================================== +# 메세지 및 다국어 처리 설정 +# ============================================== +spring: + messages: + # 다국어 메시지 파일 위치 설정 (쉼표로 구분) + basename: messages/message,messages/exception,messages/validation,messages/uri,messages/operation,messages/security-message,messages/operation-log + # 메시지 파일 인코딩 방식 + encoding: UTF-8 + # 메시지 캐시 지속 시간(초) + cache-duration: 4 + # ============================================== + # 정적 리소스 설정 + # ============================================== + web: + resources: + # 정적 리소스 캐싱 기간(초) - 1년 (31536000초) + cache: + period: 31536000 + # 리소스 버저닝 설정 + chain: + strategy: + content: + # 콘텐츠 기반 버저닝 활성화 + enabled: true + # 버저닝 적용 경로 + paths: /** + # ============================================== + # 타임리프 설정 + # ============================================== + thymeleaf: # 타임리프 템플릿 캐시 비활성화 (개발시 false 권장) + cache: false + +# ============================================== +# 서버 압축 설정 +# ============================================== +server: + compression: + # gzip 압축 활성화 여부 + enabled: true + # 압축 적용할 MIME 타입 목록 + mime-types: text/html,text/xml,text/plain,text/css,text/javascript,application/javascript + # 압축 적용 최소 응답 크기(바이트) + min-response-size: 2048 + +# ============================================== +# 관리자 관련 설정 +# ============================================== +app: + admin: + password: + validity: + # 패스워드 유효기간(일) + period: + days: 90 + change: + notice: + # 패스워드 변경 공지 기간(만료일 기준 일수) + period: + days: 7 + auth: + fail: + # 인증 실패 허용 횟수 + permit: 5 + session: + validity: + # 세션 유효기간(초) - 1시간 (3600초) + period: + seconds: 3600 + maximum: + # 최대 세션 갯수 (1일 경우 중복 로그인 불가) + num: 1 + +# ============================================== +# 로깅 설정 +# ============================================== +logging: + level: + org: + hibernate: + orm: + jdbc: + # Hibernate SQL 파라미터 바인딩 값 로깅 레벨 + bind: trace + app.module: DEBUG + org.springframework: INFO + org.apache.ibatis: TRACE + org.mybatis.spring: TRACE + # Spring Bean 등록 과정도 확인 + org.springframework.beans.factory.support.DefaultListableBeanFactory: DEBUG + file: + # 로그 파일 저장 경로 + path: ${user.home}/logs + + +# ============================================== +# MyBatis 설정 +# ============================================== +mybatis: + mapper-locations: classpath*:mappers/**/*Mapper.xml # 매퍼 파일 위치 + configuration: + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # SQL 로깅 구현체 diff --git a/admin/src/main/resources/banner.txt b/admin/src/main/resources/banner.txt new file mode 100644 index 00000000..e216fe03 --- /dev/null +++ b/admin/src/main/resources/banner.txt @@ -0,0 +1,22 @@ + +┬─┐┌─┐┌─┐┬ ┬┌─┐┬ ┌─┐ ┌─┐┌┬┐┌┬┐┬┌┐┌ +├┬┘├┤ │ └┬┘│ │ ├┤───├─┤ │││││││││ +┴└─└─┘└─┘ ┴ └─┘┴─┘└─┘ ┴ ┴─┴┘┴ ┴┴┘└┘ - admin module of recycle framework + + .-"-. + / .-. \ + .'\/ \ \ + ,' \ \ \ + / /-' \ \ . + / / ,\ '| + / / '-._| + / (_.'|_________) \ + \__< ____________/ + '.| + +GNU GENERAL PUBLIC LICENSE +Version 3, 29 June 2007 + +Copyright (C) 2007 Free Software Foundation, Inc. +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. diff --git a/admin/src/main/resources/logback-spring.xml b/admin/src/main/resources/logback-spring.xml new file mode 100644 index 00000000..ca327c01 --- /dev/null +++ b/admin/src/main/resources/logback-spring.xml @@ -0,0 +1,54 @@ + + + + + + ${FILE_LOG_CHARSET} + ${FILE_LOG_PATTERN} + + ${LOG_FILE_ERROR} + + error + ACCEPT + DENY + + + ${LOG_FILE_ERROR}.%d{yyyy-MM-dd}.%i.log + 10MB + 30 + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/admin/src/main/resources/mappers/loggedinuser/LoggedInUserRemoveMapper.xml b/admin/src/main/resources/mappers/loggedinuser/LoggedInUserRemoveMapper.xml new file mode 100644 index 00000000..087a4a56 --- /dev/null +++ b/admin/src/main/resources/mappers/loggedinuser/LoggedInUserRemoveMapper.xml @@ -0,0 +1,14 @@ + + + + + + /* deleteByCompositeId : 로그인 사용자 delete 처리 (물리삭제) */ + DELETE FROM logged_in_user + WHERE app_type = #{appType} + AND id = #{id} + + + \ No newline at end of file diff --git a/admin/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml b/admin/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml new file mode 100644 index 00000000..30814853 --- /dev/null +++ b/admin/src/main/resources/mappers/loggedinuser/LoggedInUserSaveMapper.xml @@ -0,0 +1,33 @@ + + + + + + INSERT INTO logged_in_user + ( + app_type, + id, + clientip, + last_logged_in_at + ) + VALUES + ( + #{appType}, + #{id}, + #{clientIP}, + #{lastLoggedInAt} + ) + + + + UPDATE logged_in_user + SET + clientip = #{clientIP}, + last_logged_in_at = #{lastLoggedInAt} + WHERE app_type = #{appType} + AND id = #{id} + + + \ No newline at end of file diff --git a/admin/src/main/resources/mappers/loggedinuser/LoggedInUserViewMapper.xml b/admin/src/main/resources/mappers/loggedinuser/LoggedInUserViewMapper.xml new file mode 100644 index 00000000..62ab9eab --- /dev/null +++ b/admin/src/main/resources/mappers/loggedinuser/LoggedInUserViewMapper.xml @@ -0,0 +1,18 @@ + + + + + + \ No newline at end of file diff --git a/admin/src/main/resources/messages/exception.properties b/admin/src/main/resources/messages/exception.properties new file mode 100644 index 00000000..ba833cd8 --- /dev/null +++ b/admin/src/main/resources/messages/exception.properties @@ -0,0 +1,2 @@ +exception.noSuchElement="{0}" - \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 {1} \uC785\uB2C8\uB2E4. +exception.file.no.extension=\uD655\uC7A5\uC790\uAC00 \uC5C6\uB294 \uD30C\uC77C - "{0}" \uC740(\uB294) \uC5C5\uB85C\uB4DC\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. diff --git a/admin/src/main/resources/messages/message.properties b/admin/src/main/resources/messages/message.properties new file mode 100644 index 00000000..272f9942 --- /dev/null +++ b/admin/src/main/resources/messages/message.properties @@ -0,0 +1 @@ +greeting=\uC548\uB155\uD558\uC138\uC694 \ No newline at end of file diff --git a/admin/src/main/resources/messages/message_en.properties b/admin/src/main/resources/messages/message_en.properties new file mode 100644 index 00000000..2e40f54e --- /dev/null +++ b/admin/src/main/resources/messages/message_en.properties @@ -0,0 +1 @@ +greeting=Hello \ No newline at end of file diff --git a/admin/src/main/resources/messages/operation-log.properties b/admin/src/main/resources/messages/operation-log.properties new file mode 100644 index 00000000..6a455ab9 --- /dev/null +++ b/admin/src/main/resources/messages/operation-log.properties @@ -0,0 +1,3 @@ +operate.login.success=`{0}` logged in. +operate.login.fail=`{0}` failed login. +operate.account.locked=`{0}` is locked due to authentication failure. diff --git a/admin/src/main/resources/messages/operation.properties b/admin/src/main/resources/messages/operation.properties new file mode 100644 index 00000000..a8608005 --- /dev/null +++ b/admin/src/main/resources/messages/operation.properties @@ -0,0 +1,21 @@ +operation.common.remove.choose=\uC0AD\uC81C\uD560 \uC544\uC774\uD15C\uC744 \uC120\uD0DD\uD558\uC138\uC694. +operation.common.remove.ask=\uC120\uD0DD\uD55C \uC544\uC774\uD15C\uC744 \uC815\uB9D0 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? +operation.common.remove.done=\uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +operation.common.save.done=\uC800\uC7A5\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +operation.common.move.done=\uC774\uB3D9\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +operation.common.email.to={0} \uC73C\uB85C \uC774\uBA54\uC77C\uC774 \uBC1C\uC1A1\uB418\uC5C8\uC2B5\uB2C8\uB2E4. +operation.board.exampleBoard.updated="{0}" \uAC8C\uC2DC\uBB3C\uC774 \uC218\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4! +operation.board.exampleBoard.created="{0}" \uAC8C\uC2DC\uBB3C\uC774 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4! +operation.board.exampleBoard.removed=\uC120\uD0DD\uD55C \uAC8C\uC2DC\uBB3C\uC774 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4! +operation.settings.admin.created="{0}" \uAD00\uB9AC\uC790\uAC00 \uC0DD\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4! +operation.settings.admin.updated="{0}" \uAD00\uB9AC\uC790\uAC00 \uC218\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4! +operation.settings.admin.removed=\uC120\uD0DD\uD55C \uAD00\uB9AC\uC790\uAC00 \uC0AD\uC81C\uB418\uC5C8\uC2B5\uB2C8\uB2E4! +operation.uri.save.choose.first=\uC67C\uCABD Tree View \uC5D0\uC11C \uC800\uC7A5\uD560 URI \uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694. +operation.uri.remove.choose.first=\uC67C\uCABD Tree View \uC5D0\uC11C \uC0AD\uC81C\uD560 URI \uB97C \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694. +operation.uri.remove.ask=URI \uB97C \uC815\uB9D0 \uC0AD\uC81C\uD558\uC2DC\uACA0\uC2B5\uB2C8\uAE4C? +operation.uri.move.choose=\uC774\uB3D9\uD560 \uC544\uC774\uD15C\uC744 \uC120\uD0DD\uD574\uC8FC\uC138\uC694. +operation.uri.move.save.first=\uBA3C\uC800 \uC544\uC774\uD15C\uC744 \uC800\uC7A5\uD55C \uD6C4 \uC774\uB3D9\uD574\uC8FC\uC138\uC694. +operation.uri.move.cannot.before=\uB354\uC774\uC0C1 \uC774\uC804\uC73C\uB85C \uC774\uB3D9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +operation.uri.move.cannot.after=\uB354\uC774\uC0C1 \uB2E4\uC74C\uC73C\uB85C \uC774\uB3D9\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. +operation.role.save.choose.first=\uC800\uC7A5\uD560 '\uAD00\uB9AC\uC790 \uAD8C\uD55C' \uC744 \uBA3C\uC800 \uC120\uD0DD\uD558\uC138\uC694. +operation.orderNo.updated=\uC815\uB82C\uC21C\uC11C\uAC00 \uBCC0\uACBD\uB418\uC5C8\uC2B5\uB2C8\uB2E4. diff --git a/admin/src/main/resources/messages/security-message.properties b/admin/src/main/resources/messages/security-message.properties new file mode 100644 index 00000000..3a311469 --- /dev/null +++ b/admin/src/main/resources/messages/security-message.properties @@ -0,0 +1,8 @@ +AbstractUserDetailsAuthenticationProvider.badCredentials=\uC544\uC774\uB514\uB098 \uBE44\uBC00\uBC88\uD638\uAC00 \uB9DE\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.
\uB2E4\uC2DC \uD655\uC778\uD574\uC8FC\uC138\uC694. +AbstractUserDetailsAuthenticationProvider.credentialsExpired=\uBE44\uBC00\uBC88\uD638 \uC720\uD6A8\uAE30\uAC04\uC774 \uB9CC\uB8CC \uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uAD00\uB9AC\uC790\uC5D0\uAC8C \uBB38\uC758\uD558\uC138\uC694. +AbstractUserDetailsAuthenticationProvider.disabled=\uACC4\uC815\uC774 \uBE44\uD65C\uC131\uD654\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uAD00\uB9AC\uC790\uC5D0\uAC8C \uBB38\uC758\uD558\uC138\uC694 +AbstractUserDetailsAuthenticationProvider.expired=\uACC4\uC815\uC774 \uB9CC\uB8CC\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uAD00\uB9AC\uC790\uC5D0\uAC8C \uBB38\uC758\uD558\uC138\uC694. +AbstractUserDetailsAuthenticationProvider.locked=\uACC4\uC815\uC774 \uC7A0\uACA8\uC788\uC2B5\uB2C8\uB2E4. \uAD00\uB9AC\uC790\uC5D0\uAC8C \uBB38\uC758\uD558\uC138\uC694. +security.password.change.notify=\uBE44\uBC00\uBC88\uD638 \uBCC0\uACBD \uB9CC\uB8CC {0}\uC77C\uC804 \uC785\uB2C8\uB2E4. +security.auth.fail.exceed={0}\uD68C \uC774\uC0C1 \uB85C\uADF8\uC778 \uC2E4\uD328\uB85C \uACC4\uC815\uC774 \uC7A0\uAE40\uCC98\uB9AC \uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD574\uC81C\uB97C \uC6D0\uD558\uBA74 \uAD00\uB9AC\uC790\uC5D0\uAC8C \uBB38\uC758\uD558\uC138\uC694. +security.auth.duplicate.login=\uB3D9\uC77C\uD55C \uACC4\uC815\uC73C\uB85C \uB85C\uADF8\uC778\uD55C \uC815\uBCF4\uAC00 \uC788\uC2B5\uB2C8\uB2E4. \uC774\uC804 \uB85C\uADF8\uC778 \uC815\uBCF4\uB97C \uCC28\uB2E8\uD569\uB2C8\uB2E4. diff --git a/admin/src/main/resources/messages/uri.properties b/admin/src/main/resources/messages/uri.properties new file mode 100644 index 00000000..b4ca39d0 --- /dev/null +++ b/admin/src/main/resources/messages/uri.properties @@ -0,0 +1,29 @@ +uri=Home +uri.admin.board=\uAC8C\uC2DC\uD310 +uri.admin.board.exampleBoard=(deprecated) \uC608\uC81C \uAC8C\uC2DC\uD310 +uri.admin.board.exampleBoard.create=(deprecated) \uC608\uC81C \uAC8C\uC2DC\uD310 \uB4F1\uB85D +uri.admin.board.exampleBoard.update.{{pathVar}}=(deprecated) \uC608\uC81C \uAC8C\uC2DC\uD310 \uC218\uC815 +uri.admin.board.article=\uC608\uC81C \uAC8C\uC2DC\uD310 +uri.admin.board.article.create=\uC608\uC81C \uAC8C\uC2DC\uD310 \uB4F1\uB85D +uri.admin.board.article.update.{{pathVar}}=\uC608\uC81C \uAC8C\uC2DC\uD310 \uC218\uC815 +uri.admin.settings=Settings +uri.admin.settings.admins.group=\uAD00\uB9AC\uC790 & \uC5ED\uD560 +uri.admin.settings.admins=\uAD00\uB9AC\uC790 +uri.admin.settings.admins.create=\uB4F1\uB85D +uri.admin.settings.admins.update.{{pathVar}}=\uC218\uC815 +uri.admin.settings.uri.admin=URI \uAD00\uB9AC (Admin) +uri.admin.settings.uri.front=URI \uAD00\uB9AC (Front) +uri.admin.settings.uicode=UI \uCF54\uB4DC \uAD00\uB9AC +uri.admin.settings.adminRoles=\uC5ED\uD560 (Role) +uri.admin.settings.adminPrivilege=\uAD8C\uD55C (Privilege) +uri.admin.settings.user.group=\uC0AC\uC6A9\uC790 & \uC5ED\uD560 +uri.admin.settings.user=\uC0AC\uC6A9\uC790 +uri.admin.settings.user.update=\uC0AC\uC6A9\uC790 \uC218\uC815 +uri.admin.settings.user.role=\uC0AC\uC6A9\uC790 \uC5ED\uD560 (Role) +uri.admin.settings.user.privilege=\uC0AC\uC6A9\uC790 \uAD8C\uD55C (Privilege) +uri.admin.analysis=\uBD84\uC11D +uri.admin.analysis.operationLog=Operation Log (\uC218\uD589\uB85C\uADF8) +uri.admin.analysis.operationLog.{{pathVar}}=\uC218\uD589\uB85C\uADF8 \uC0C1\uC138 +uri.admin.addons=Add-ons (\uBD80\uAC00\uAE30\uB2A5) +uri.admin.addons.email=Email +uri.admin.addons.email.form=Email \uBC1C\uC1A1\uD3FC diff --git a/admin/src/main/resources/messages/validation.properties b/admin/src/main/resources/messages/validation.properties new file mode 100644 index 00000000..a35350d8 --- /dev/null +++ b/admin/src/main/resources/messages/validation.properties @@ -0,0 +1,20 @@ +valid.common.required=\uD544\uC218\uC785\uB825 \uD56D\uBAA9\uC785\uB2C8\uB2E4. +valid.common.required.size={0} \uAC1C \uD56D\uBAA9\uC774 \uB2F4\uACA8\uC788\uC5B4\uC57C \uD569\uB2C8\uB2E4. +valid.common.required.size.min={0} \uAC1C \uC774\uC0C1 \uD56D\uBAA9\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. +valid.common.required.remove.item=\uC0AD\uC81C\uD560 \uC544\uC774\uD15C\uC774 \uC5C6\uC2B5\uB2C8\uB2E4. +valid.common.email.wrong=\uC774\uBA54\uC77C \uD615\uC2DD\uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. +valid.common.nickname.wrong=\uB2C9\uB124\uC784(2-10\uAE00\uC790)\uC740 \uD55C\uAE00,\uC601\uC5B4 \uB300\uC18C\uBB38\uC790, -, _ \uB9CC \uC785\uB825\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. +valid.common.password.wrong=6\uC790 \uC774\uC0C1 15\uC790 \uC774\uD558 \uB300,\uC18C,\uD2B9\uC218\uBB38\uC790\uAC00 \uD3EC\uD568 \uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. +valid.common.already.exists=\uC774\uBBF8 \uB4F1\uB85D\uB41C {0} \uC785\uB2C8\uB2E4. +valid.common.endWith.not=\uB9C8\uC9C0\uB9C9\uC774 "{0}"\uC73C\uB85C \uB05D\uB098\uC11C\uB294 \uC548\uB429\uB2C8\uB2E4. +valid.common.date.invalid=\uAC8C\uC2DC\uC77C\uC744 \uD655\uC778\uD574 \uC8FC\uC138\uC694. +valid.uri.must.startWith.slash=URI \uB294 '/'\uB85C \uC2DC\uC791\uB418\uC5B4\uC57C \uD569\uB2C8\uB2E4. +valid.uri.mustNot.endWith.slash=URI \uB294 '/'\uB85C \uB05D\uB098\uC11C\uB294 \uD569\uB2C8\uB2E4. +valid.uri.sort.size=\uC815\uB82C\uD558\uB824\uBA74 2\uAC1C\uC758 \uC544\uC774\uD15C \uBAA9\uB85D\uC774 \uD544\uC694\uD569\uB2C8\uB2E4. +valid.uri.text=URI \uC124\uBA85(text)\uC744 \uC785\uB825\uD558\uC138\uC694. +valid.uri.uri=URI \uB97C \uC785\uB825\uD558\uC138\uC694. +valid.uri.already.exist={0} \uB294 \uC774\uBBF8 \uB4F1\uB85D\uB41C URI \uC785\uB2C8\uB2E4. +valid.role.id.mustStartWith.role=\uAD8C\uD55C\uC740 \uBC18\uB4DC\uC2DC 'ROLE_' \uB85C \uC2DC\uC791\uD574\uC57C\uD569\uB2C8\uB2E4. +valid.admin.id.notEndWith.dot=\uB9C8\uC9C0\uB9C9\uC774 \uC810(.)\uC73C\uB85C \uB05D\uB098\uC11C\uB294 \uC548\uB429\uB2C8\uB2E4. +uri.remove.prevent.root=\uCD5C\uC0C1\uC704 URI \uC568\uB9AC\uBA3C\uD2B8\uB294 \uC0AD\uC81C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. + diff --git a/admin/src/main/resources/static/library/bootstrap-treeview/bootstrap-treeview.min.css b/admin/src/main/resources/static/library/bootstrap-treeview/bootstrap-treeview.min.css new file mode 100644 index 00000000..9e40d885 --- /dev/null +++ b/admin/src/main/resources/static/library/bootstrap-treeview/bootstrap-treeview.min.css @@ -0,0 +1 @@ +.treeview .list-group-item{cursor:pointer}.treeview span.indent{margin-left:10px;margin-right:10px}.treeview span.icon,.treeview span.image{width:12px;margin-right:5px}.treeview .node-disabled{color:silver;cursor:not-allowed}.treeview .node-hidden{display:none}.treeview span.image{display:inline-block;height:1.19em;vertical-align:middle;background-size:contain;background-repeat:no-repeat;line-height:1em}.treeview span.icon.node-icon-background{padding:2px;width:calc(1em + 4px);height:calc(1em + 4px);line-height:1em} \ No newline at end of file diff --git a/admin/src/main/resources/static/library/bootstrap-treeview/bootstrap-treeview.min.js b/admin/src/main/resources/static/library/bootstrap-treeview/bootstrap-treeview.min.js new file mode 100644 index 00000000..d176d5f1 --- /dev/null +++ b/admin/src/main/resources/static/library/bootstrap-treeview/bootstrap-treeview.min.js @@ -0,0 +1,2 @@ +/* 참고 - https://github.com/patternfly/patternfly-bootstrap-treeview */ +!function(a,b,c,d){"use strict";var e="treeview",f={};f.settings={injectStyle:!0,levels:2,expandIcon:"glyphicon glyphicon-plus",collapseIcon:"glyphicon glyphicon-minus",loadingIcon:"glyphicon glyphicon-hourglass",emptyIcon:"glyphicon",nodeIcon:"",selectedIcon:"",checkedIcon:"glyphicon glyphicon-check",partiallyCheckedIcon:"glyphicon glyphicon-expand",uncheckedIcon:"glyphicon glyphicon-unchecked",tagsClass:"badge",color:d,backColor:d,borderColor:d,changedNodeColor:"#39A5DC",onhoverColor:"#F5F5F5",selectedColor:"#FFFFFF",selectedBackColor:"#428bca",searchResultColor:"#D9534F",searchResultBackColor:d,highlightSelected:!0,highlightSearchResults:!0,showBorder:!0,showIcon:!0,showImage:!1,showCheckbox:!1,checkboxFirst:!1,highlightChanges:!1,showTags:!1,multiSelect:!1,preventUnselect:!1,allowReselect:!1,hierarchicalCheck:!1,propagateCheckEvent:!1,wrapNodeText:!1,onLoading:d,onLoadingFailed:d,onInitialized:d,onNodeRendered:d,onRendered:d,onDestroyed:d,onNodeChecked:d,onNodeCollapsed:d,onNodeDisabled:d,onNodeEnabled:d,onNodeExpanded:d,onNodeChanged:d,onNodeSelected:d,onNodeUnchecked:d,onNodeUnselected:d,onSearchComplete:d,onSearchCleared:d},f.options={silent:!1,ignoreChildren:!1},f.searchOptions={ignoreCase:!0,exactMatch:!1,revealResults:!0},f.dataUrl={method:"GET",dataType:"json",cache:!1};var g=function(b,c){return this.$element=a(b),this._elementId=b.id,this._styleId=this._elementId+"-style",this._init(c),{options:this._options,init:a.proxy(this._init,this),remove:a.proxy(this._remove,this),findNodes:a.proxy(this.findNodes,this),getNodes:a.proxy(this.getNodes,this),getParents:a.proxy(this.getParents,this),getSiblings:a.proxy(this.getSiblings,this),getSelected:a.proxy(this.getSelected,this),getUnselected:a.proxy(this.getUnselected,this),getExpanded:a.proxy(this.getExpanded,this),getCollapsed:a.proxy(this.getCollapsed,this),getChecked:a.proxy(this.getChecked,this),getUnchecked:a.proxy(this.getUnchecked,this),getDisabled:a.proxy(this.getDisabled,this),getEnabled:a.proxy(this.getEnabled,this),addNode:a.proxy(this.addNode,this),addNodeAfter:a.proxy(this.addNodeAfter,this),addNodeBefore:a.proxy(this.addNodeBefore,this),removeNode:a.proxy(this.removeNode,this),updateNode:a.proxy(this.updateNode,this),selectNode:a.proxy(this.selectNode,this),unselectNode:a.proxy(this.unselectNode,this),toggleNodeSelected:a.proxy(this.toggleNodeSelected,this),collapseAll:a.proxy(this.collapseAll,this),collapseNode:a.proxy(this.collapseNode,this),expandAll:a.proxy(this.expandAll,this),expandNode:a.proxy(this.expandNode,this),toggleNodeExpanded:a.proxy(this.toggleNodeExpanded,this),revealNode:a.proxy(this.revealNode,this),checkAll:a.proxy(this.checkAll,this),checkNode:a.proxy(this.checkNode,this),uncheckAll:a.proxy(this.uncheckAll,this),uncheckNode:a.proxy(this.uncheckNode,this),toggleNodeChecked:a.proxy(this.toggleNodeChecked,this),unmarkCheckboxChanges:a.proxy(this.unmarkCheckboxChanges,this),disableAll:a.proxy(this.disableAll,this),disableNode:a.proxy(this.disableNode,this),enableAll:a.proxy(this.enableAll,this),enableNode:a.proxy(this.enableNode,this),toggleNodeDisabled:a.proxy(this.toggleNodeDisabled,this),search:a.proxy(this.search,this),clearSearch:a.proxy(this.clearSearch,this)}};g.prototype._init=function(b){this._tree=[],this._initialized=!1,this._options=a.extend({},f.settings,b),this._template.icon.empty.addClass(this._options.emptyIcon),this._destroy(),this._subscribeEvents(),this._triggerEvent("loading",null,f.options),this._load(b).then(a.proxy(function(b){return this._tree=a.extend(!0,[],b)},this),a.proxy(function(a){this._triggerEvent("loadingFailed",a,f.options)},this)).then(a.proxy(function(a){return this._setInitialStates({nodes:a},0)},this)).then(a.proxy(function(){this._render()},this))},g.prototype._load=function(b){var c=new a.Deferred;return b.data?this._loadLocalData(b,c):b.dataUrl&&this._loadRemoteData(b,c),c.promise()},g.prototype._loadRemoteData=function(b,c){a.ajax(a.extend(!0,{},f.dataUrl,b.dataUrl)).done(function(a){c.resolve(a)}).fail(function(a,b,d){c.reject(d)})},g.prototype._loadLocalData=function(b,c){c.resolve("string"==typeof b.data?JSON.parse(b.data):a.extend(!0,[],b.data))},g.prototype._remove=function(){this._destroy(),a.removeData(this,e),a("#"+this._styleId).remove()},g.prototype._destroy=function(){this._initialized&&(this._initialized=!1,this._triggerEvent("destroyed",null,f.options),this._unsubscribeEvents(),this.$wrapper.remove(),this.$wrapper=null)},g.prototype._unsubscribeEvents=function(){this.$element.off("loading"),this.$element.off("loadingFailed"),this.$element.off("initialized"),this.$element.off("nodeRendered"),this.$element.off("rendered"),this.$element.off("destroyed"),this.$element.off("click"),this.$element.off("nodeChecked"),this.$element.off("nodeCollapsed"),this.$element.off("nodeDisabled"),this.$element.off("nodeEnabled"),this.$element.off("nodeExpanded"),this.$element.off("nodeChanged"),this.$element.off("nodeSelected"),this.$element.off("nodeUnchecked"),this.$element.off("nodeUnselected"),this.$element.off("searchComplete"),this.$element.off("searchCleared")},g.prototype._subscribeEvents=function(){this._unsubscribeEvents(),"function"==typeof this._options.onLoading&&this.$element.on("loading",this._options.onLoading),"function"==typeof this._options.onLoadingFailed&&this.$element.on("loadingFailed",this._options.onLoadingFailed),"function"==typeof this._options.onInitialized&&this.$element.on("initialized",this._options.onInitialized),"function"==typeof this._options.onNodeRendered&&this.$element.on("nodeRendered",this._options.onNodeRendered),"function"==typeof this._options.onRendered&&this.$element.on("rendered",this._options.onRendered),"function"==typeof this._options.onDestroyed&&this.$element.on("destroyed",this._options.onDestroyed),this.$element.on("click",a.proxy(this._clickHandler,this)),"function"==typeof this._options.onNodeChecked&&this.$element.on("nodeChecked",this._options.onNodeChecked),"function"==typeof this._options.onNodeCollapsed&&this.$element.on("nodeCollapsed",this._options.onNodeCollapsed),"function"==typeof this._options.onNodeDisabled&&this.$element.on("nodeDisabled",this._options.onNodeDisabled),"function"==typeof this._options.onNodeEnabled&&this.$element.on("nodeEnabled",this._options.onNodeEnabled),"function"==typeof this._options.onNodeExpanded&&this.$element.on("nodeExpanded",this._options.onNodeExpanded),"function"==typeof this._options.onNodeChanged&&this.$element.on("nodeChanged",this._options.onNodeChanged),"function"==typeof this._options.onNodeSelected&&this.$element.on("nodeSelected",this._options.onNodeSelected),"function"==typeof this._options.onNodeUnchecked&&this.$element.on("nodeUnchecked",this._options.onNodeUnchecked),"function"==typeof this._options.onNodeUnselected&&this.$element.on("nodeUnselected",this._options.onNodeUnselected),"function"==typeof this._options.onSearchComplete&&this.$element.on("searchComplete",this._options.onSearchComplete),"function"==typeof this._options.onSearchCleared&&this.$element.on("searchCleared",this._options.onSearchCleared)},g.prototype._triggerEvent=function(b,c,d){d&&!d.silent&&this.$element.trigger(b,a.extend(!0,{},c))},g.prototype._setInitialStates=function(b,c){return this._nodes={},a.when.apply(this,this._setInitialState(b,c)).done(a.proxy(function(){this._orderedNodes=this._sortNodes(),this._inheritCheckboxChanges(),this._triggerEvent("initialized",this._orderedNodes,f.options)},this))},g.prototype._setInitialState=function(b,c,e){if(b.nodes){c+=1,e=e||[];var f=b;return a.each(b.nodes,a.proxy(function(b,g){var h=new a.Deferred;e.push(h.promise()),g.level=c,g.index=b,g.nodeId=f&&f.nodeId?f.nodeId+"."+g.index:c-1+"."+g.index,g.parentId=f.nodeId,g.hasOwnProperty("selectable")||(g.selectable=!0),g.hasOwnProperty("checkable")||(g.checkable=!0),g.state=g.state||{},g.state.hasOwnProperty("checked")||(g.state.checked=!1),this._options.hierarchicalCheck&&"undefined"===g.state.checked&&(g.state.checked=d),g.state.hasOwnProperty("disabled")||(g.state.disabled=!1),g.state.hasOwnProperty("expanded")||(!g.state.disabled&&c0?g.state.expanded=!0:g.state.expanded=!1),g.state.hasOwnProperty("selected")||(g.state.selected=!1),f&&f.state&&f.state.expanded||c<=this._options.levels?g.state.visible=!0:g.state.visible=!1,g.nodes&&(g.nodes.length>0?this._setInitialState(g,c,e):delete g.nodes),this._nodes[g.nodeId]=g,h.resolve()},this)),e}},g.prototype._sortNodes=function(){return a.map(Object.keys(this._nodes).sort(function(a,b){if(a===b)return 0;for(var a=a.split(".").map(function(a){return parseInt(a)}),b=b.split(".").map(function(a){return parseInt(a)}),c=Math.max(a.length,b.length),e=0;e0)return 1;if(a[e]-b[e]<0)return-1}}),a.proxy(function(a,b){return this._nodes[a]},this))},g.prototype._clickHandler=function(b){var c=a(b.target),d=this.targetNode(c);if(d&&!d.state.disabled){var e=c.attr("class")?c.attr("class").split(" "):[];e.indexOf("expand-icon")!==-1?this._toggleExpanded(d,a.extend({},f.options)):e.indexOf("check-icon")!==-1?d.checkable&&this._toggleChecked(d,a.extend({},f.options)):d.selectable?this._toggleSelected(d,a.extend({},f.options)):this._toggleExpanded(d,a.extend({},f.options))}},g.prototype.targetNode=function(a){var b=a.closest("li.list-group-item").attr("data-nodeId"),c=this._nodes[b];return c||console.log("Error: node does not exist"),c},g.prototype._toggleExpanded=function(a,b){a&&("function"==typeof this._options.lazyLoad&&a.lazyLoad?this._lazyLoad(a):this._setExpanded(a,!a.state.expanded,b))},g.prototype._lazyLoad=function(a){a.$el.children("span.expand-icon").removeClass(this._options.expandIcon).addClass(this._options.loadingIcon);var b=this;this._options.lazyLoad(a,function(c){b.addNode(c,a)}),delete a.lazyLoad},g.prototype._setExpanded=function(b,c,d){d&&c===b.state.expanded||(c&&b.nodes?(b.state.expanded=!0,b.$el&&b.$el.children("span.expand-icon").removeClass(this._options.expandIcon).removeClass(this._options.loadingIcon).addClass(this._options.collapseIcon),b.nodes&&d&&a.each(b.nodes,a.proxy(function(a,b){this._setVisible(b,!0,d)},this)),this._triggerEvent("nodeExpanded",b,d)):c||(b.state.expanded=!1,b.$el&&b.$el.children("span.expand-icon").removeClass(this._options.collapseIcon).addClass(this._options.expandIcon),b.nodes&&d&&a.each(b.nodes,a.proxy(function(a,b){this._setVisible(b,!1,d),this._setExpanded(b,!1,d)},this)),this._triggerEvent("nodeCollapsed",b,d)))},g.prototype._setVisible=function(a,b,c){c&&b===a.state.visible||(b?(a.state.visible=!0,a.$el&&a.$el.removeClass("node-hidden")):(a.state.visible=!1,a.$el&&a.$el.addClass("node-hidden")))},g.prototype._toggleSelected=function(a,b){if(a)return this._setSelected(a,!a.state.selected,b),this},g.prototype._setSelected=function(b,c,d,e){if(!d||c!==b.state.selected){if(c)this._options.multiSelect||a.each(this._findNodes("true","state.selected"),a.proxy(function(b,c){this._setSelected(c,!1,a.extend(d,{unselecting:!0}),!0)},this)),b.state.selected=!0,b.$el&&(b.$el.addClass("node-selected"),(b.selectedIcon||this._options.selectedIcon)&&b.$el.children("span.node-icon").removeClass(b.icon||this._options.nodeIcon).addClass(b.selectedIcon||this._options.selectedIcon)),this._triggerEvent("nodeSelected",b,d),this._triggerEvent("nodeChanged",b,d);else{if(this._options.preventUnselect&&d&&!d.unselecting&&1===this._findNodes("true","state.selected").length)return this._options.allowReselect&&(this._triggerEvent("nodeSelected",b,d),this._triggerEvent("nodeChanged",b,d)),this;b.state.selected=!1,b.$el&&(b.$el.removeClass("node-selected"),(b.selectedIcon||this._options.selectedIcon)&&b.$el.children("span.node-icon").removeClass(b.selectedIcon||this._options.selectedIcon).addClass(b.icon||this._options.nodeIcon)),this._triggerEvent("nodeUnselected",b,d),e||this._triggerEvent("nodeChanged",b,d)}return this}},g.prototype._inheritCheckboxChanges=function(){this._options.showCheckbox&&this._options.highlightChanges&&(this._checkedNodes=a.grep(this._orderedNodes,function(a){return a.state.checked}))},g.prototype._toggleChecked=function(b,c){if(b){if(this._options.hierarchicalCheck){var e,f=a.extend({},c,{silent:c.silent||!this._options.propagateCheckEvent}),g=b;for(b.state.checked=!b.state.checked;g=this._nodes[g.parentId];)e=g.nodes.reduce(function(a,b){return a===b.state.checked?a:d},g.nodes[0].state.checked),this._setChecked(g,e,f);if(b.nodes&&b.nodes.length>0)for(var h,i=b.nodes.slice();i&&i.length>0;)h=i.pop(),this._setChecked(h,b.state.checked,f),h.nodes&&h.nodes.length>0&&(i=i.concat(h.nodes.slice()));b.state.checked=!b.state.checked}this._setChecked(b,!b.state.checked,c)}},g.prototype._setChecked=function(a,b,c){c&&b===a.state.checked||(this._options.highlightChanges&&a.$el.toggleClass("node-check-changed",this._checkedNodes.indexOf(a)==-1==b),b?(a.state.checked=!0,a.$el&&(a.$el.addClass("node-checked").removeClass("node-checked-partial"),a.$el.children("span.check-icon").removeClass(this._options.uncheckedIcon).removeClass(this._options.partiallyCheckedIcon).addClass(this._options.checkedIcon)),this._triggerEvent("nodeChecked",a,c)):b===d&&this._options.hierarchicalCheck?(a.state.checked=d,a.$el&&(a.$el.addClass("node-checked-partial").removeClass("node-checked"),a.$el.children("span.check-icon").removeClass(this._options.uncheckedIcon).removeClass(this._options.checkedIcon).addClass(this._options.partiallyCheckedIcon)),this._triggerEvent("nodeUnchecked",a,c)):(a.state.checked=!1,a.$el&&(a.$el.removeClass("node-checked node-checked-partial"),a.$el.children("span.check-icon").removeClass(this._options.checkedIcon).removeClass(this._options.partiallyCheckedIcon).addClass(this._options.uncheckedIcon)),this._triggerEvent("nodeUnchecked",a,c)))},g.prototype._setDisabled=function(a,b,c){c&&b===a.state.disabled||(b?(a.state.disabled=!0,c&&!c.keepState&&(this._setSelected(a,!1,c),this._setChecked(a,!1,c),this._setExpanded(a,!1,c)),a.$el&&a.$el.addClass("node-disabled"),this._triggerEvent("nodeDisabled",a,c)):(a.state.disabled=!1,a.$el&&a.$el.removeClass("node-disabled"),this._triggerEvent("nodeEnabled",a,c)))},g.prototype._setSearchResult=function(a,b,c){c&&b===a.searchResult||(b?(a.searchResult=!0,a.$el&&a.$el.addClass("node-result")):(a.searchResult=!1,a.$el&&a.$el.removeClass("node-result")))},g.prototype._render=function(){this._initialized||(this.$wrapper=this._template.tree.clone(),this.$element.empty().addClass(e).append(this.$wrapper),this._injectStyle(),this._initialized=!0);var b;a.each(this._orderedNodes,a.proxy(function(a,c){this._renderNode(c,b),b=c},this)),this._triggerEvent("rendered",this._orderedNodes,f.options)},g.prototype._renderNode=function(b,c){if(b){b.$el?b.$el.empty():b.$el=this._newNodeEl(b,c).addClass("node-"+this._elementId),b.$el.addClass(b["class"]),b.id&&b.$el.attr("id",b.id),b.dataAttr&&a.each(b.dataAttr,function(a,c){b.$el.attr("data-"+a,c)}),b.$el.attr("data-nodeId",b.nodeId),b.tooltip&&b.$el.attr("title",b.tooltip);for(var e=0;e '+this._buildStyle()+" ").appendTo("head")},g.prototype._buildStyle=function(){var b=".node-"+this._elementId+"{";if(this._options.color&&(b+="color:"+this._options.color+";"),this._options.backColor&&(b+="background-color:"+this._options.backColor+";"),this._options.showBorder?this._options.borderColor&&(b+="border:1px solid "+this._options.borderColor+";"):b+="border:none;",b+="}",this._options.onhoverColor&&(b+=".node-"+this._elementId+":not(.node-disabled):hover{background-color:"+this._options.onhoverColor+";}"),this._options.highlightSearchResults&&(this._options.searchResultColor||this._options.searchResultBackColor)){var c="";this._options.searchResultColor&&(c+="color:"+this._options.searchResultColor+";"),this._options.searchResultBackColor&&(c+="background-color:"+this._options.searchResultBackColor+";"),b+=".node-"+this._elementId+".node-result{"+c+"}",b+=".node-"+this._elementId+".node-result:hover{"+c+"}"}if(this._options.highlightSelected&&(this._options.selectedColor||this._options.selectedBackColor)){var c="";this._options.selectedColor&&(c+="color:"+this._options.selectedColor+";"),this._options.selectedBackColor&&(c+="background-color:"+this._options.selectedBackColor+";"),b+=".node-"+this._elementId+".node-selected{"+c+"}",b+=".node-"+this._elementId+".node-selected:hover{"+c+"}"}if(this._options.highlightChanges){var c="color: "+this._options.changedNodeColor+";";b+=".node-"+this._elementId+".node-check-changed{"+c+"}"}return a.each(this._orderedNodes,a.proxy(function(a,c){if(c.color||c.backColor){var d="";c.color&&(d+="color:"+c.color+";"),c.backColor&&(d+="background-color:"+c.backColor+";"),b+=".node-"+this._elementId+'[data-nodeId="'+c.nodeId+'"]{'+d+"}"}},this)),this._css+b},g.prototype._template={tree:a('
    '),node:a('
  • '),indent:a(''),icon:{node:a(''),expand:a(''),check:a(''),empty:a('')},image:a(''),badge:a(""),text:a('')},g.prototype._css=".treeview .list-group-item{cursor:pointer}.treeview span.indent{margin-left:10px;margin-right:10px}.treeview span.icon{width:12px;margin-right:5px}.treeview .node-disabled{color:silver;cursor:not-allowed}",g.prototype.findNodes=function(a,b,c){return this._findNodes(a,b,c)},g.prototype.getNodes=function(){return this._orderedNodes},g.prototype.getParents=function(b){b instanceof Array||(b=[b]);var c=[];return a.each(b,a.proxy(function(a,b){var d=!!b.parentId&&this._nodes[b.parentId];d&&c.push(d)},this)),c},g.prototype.getSiblings=function(b){b instanceof Array||(b=[b]);var c=[];return a.each(b,a.proxy(function(a,b){var d=this.getParents([b]),e=d[0]?d[0].nodes:this._tree;c=e.filter(function(a){return a.nodeId!==b.nodeId})},this)),a.map(c,function(a){return a})},g.prototype.getSelected=function(){return this._findNodes("true","state.selected")},g.prototype.getUnselected=function(){return this._findNodes("false","state.selected")},g.prototype.getExpanded=function(){return this._findNodes("true","state.expanded")},g.prototype.getCollapsed=function(){return this._findNodes("false","state.expanded")},g.prototype.getChecked=function(){return this._findNodes("true","state.checked")},g.prototype.getUnchecked=function(){return this._findNodes("false","state.checked")},g.prototype.getDisabled=function(){return this._findNodes("true","state.disabled")},g.prototype.getEnabled=function(){return this._findNodes("false","state.disabled")},g.prototype.addNode=function(b,c,d,e){b instanceof Array||(b=[b]),c instanceof Array&&(c=c[0]),e=a.extend({},f.options,e);var g;g=c&&c.nodes?c.nodes:c?c.nodes=[]:this._tree,a.each(b,a.proxy(function(a,b){var c="number"==typeof d?d+a:g.length+1;g.splice(c,0,b)},this)),this._setInitialStates({nodes:this._tree},0).done(a.proxy(function(){c&&!c.state.expanded&&this._setExpanded(c,!0,e),this._render()},this))},g.prototype.addNodeAfter=function(b,c,d){b instanceof Array||(b=[b]),c instanceof Array&&(c=c[0]),d=a.extend({},f.options,d),this.addNode(b,this.getParents(c)[0],c.index+1,d)},g.prototype.addNodeBefore=function(b,c,d){b instanceof Array||(b=[b]),c instanceof Array&&(c=c[0]),d=a.extend({},f.options,d),this.addNode(b,this.getParents(c)[0],c.index,d)},g.prototype.removeNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c);var d,e;a.each(b,a.proxy(function(a,b){e=this._nodes[b.parentId],d=e?e.nodes:this._tree,d.splice(b.index,1),this._removeNodeEl(b)},this)),this._setInitialStates({nodes:this._tree},0).done(this._render.bind(this))},g.prototype.updateNode=function(b,c,d){b instanceof Array&&(b=b[0]),d=a.extend({},f.options,d);var e,g=this._nodes[b.parentId];e=g?g.nodes:this._tree,e.splice(b.index,1,c),this._removeNodeEl(b),this._setInitialStates({nodes:this._tree},0).done(this._render.bind(this))},g.prototype.selectNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setSelected(b,!0,c)},this))},g.prototype.unselectNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setSelected(b,!1,c)},this))},g.prototype.toggleNodeSelected=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._toggleSelected(b,c)},this))},g.prototype.collapseAll=function(b){b=a.extend({},f.options,b),b.levels=b.levels||999,this.collapseNode(this._tree,b)},g.prototype.collapseNode=function(b,c){c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setExpanded(b,!1,c)},this))},g.prototype.expandAll=function(b){b=a.extend({},f.options,b),b.levels=b.levels||999,this.expandNode(this._tree,b)},g.prototype.expandNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){b.state.expanded||("function"==typeof this._options.lazyLoad&&b.lazyLoad&&this._lazyLoad(b),this._setExpanded(b,!0,c),b.nodes&&this._expandLevels(b.nodes,c.levels-1,c))},this))},g.prototype._expandLevels=function(b,c,d){b instanceof Array||(b=[b]),d=a.extend({},f.options,d),a.each(b,a.proxy(function(a,b){this._setExpanded(b,c>0,d),b.nodes&&this._expandLevels(b.nodes,c-1,d)},this))},g.prototype.revealNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){for(var d,e=b;d=this.getParents([e])[0];)e=d,this._setExpanded(e,!0,c)},this))},g.prototype.toggleNodeExpanded=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._toggleExpanded(b,c)},this))},g.prototype.checkAll=function(b){b=a.extend({},f.options,b);var c=a.grep(this._orderedNodes,function(a){return!a.state.checked});a.each(c,a.proxy(function(a,c){this._setChecked(c,!0,b)},this))},g.prototype.checkNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setChecked(b,!0,c)},this))},g.prototype.uncheckAll=function(b){b=a.extend({},f.options,b);var c=a.grep(this._orderedNodes,function(a){return a.state.checked||a.state.checked===d});a.each(c,a.proxy(function(a,c){this._setChecked(c,!1,b)},this))},g.prototype.uncheckNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setChecked(b,!1,c)},this))},g.prototype.toggleNodeChecked=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._toggleChecked(b,c)},this))},g.prototype.unmarkCheckboxChanges=function(){this._inheritCheckboxChanges(),a.each(this._nodes,function(a,b){b.$el.removeClass("node-check-changed")})},g.prototype.disableAll=function(b){b=a.extend({},f.options,b);var c=this._findNodes("false","state.disabled");a.each(c,a.proxy(function(a,c){this._setDisabled(c,!0,b)},this))},g.prototype.disableNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setDisabled(b,!0,c)},this))},g.prototype.enableAll=function(b){b=a.extend({},f.options,b);var c=this._findNodes("true","state.disabled");a.each(c,a.proxy(function(a,c){this._setDisabled(c,!1,b)},this))},g.prototype.enableNode=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setDisabled(b,!1,c)},this))},g.prototype.toggleNodeDisabled=function(b,c){b instanceof Array||(b=[b]),c=a.extend({},f.options,c),a.each(b,a.proxy(function(a,b){this._setDisabled(b,!b.state.disabled,c)},this))},g.prototype.search=function(b,c){c=a.extend({},f.searchOptions,c);var d=this._getSearchResults(),e=[];if(b&&b.length>0){c.exactMatch&&(b="^"+b+"$");var g="g";c.ignoreCase&&(g+="i"),e=this._findNodes(b,"text",g)}return a.each(this._diffArray(e,d),a.proxy(function(a,b){this._setSearchResult(b,!1,c)},this)),a.each(this._diffArray(d,e),a.proxy(function(a,b){this._setSearchResult(b,!0,c)},this)),e&&c.revealResults&&this.revealNode(e),this._triggerEvent("searchComplete",e,c),e},g.prototype.clearSearch=function(b){b=a.extend({},{render:!0},b);var c=a.each(this._getSearchResults(),a.proxy(function(a,c){this._setSearchResult(c,!1,b)},this));this._triggerEvent("searchCleared",c,b)},g.prototype._getSearchResults=function(){return this._findNodes("true","searchResult")},g.prototype._diffArray=function(b,c){var d=[];return a.grep(c,function(c){a.inArray(c,b)===-1&&d.push(c)}),d},g.prototype._findNodes=function(b,c,d){return c=c||"text",d=d||"g",a.grep(this._orderedNodes,a.proxy(function(a){var e=this._getNodeValue(a,c);if("string"==typeof e)return e.match(new RegExp(b,d))},this))},g.prototype._getNodeValue=function(a,b){var c=b.indexOf(".");if(c>0){var e=a[b.substring(0,c)],f=b.substring(c+1,b.length);return this._getNodeValue(e,f)}return a.hasOwnProperty(b)&&a[b]!==d?a[b].toString():d};var h=function(a){b.console&&b.console.error(a)};a.fn[e]=function(b,c){var d;if(0==this.length)throw"No element has been found!";return this.each(function(){var f=a.data(this,e);"string"==typeof b?f?a.isFunction(f[b])&&"_"!==b.charAt(0)?(c instanceof Array||(c=[c]),d=f[b].apply(f,c)):h("No such method : "+b):h("Not initialized, can not call method : "+b):"boolean"==typeof b?d=f:a.data(this,e,new g(this,a.extend(!0,{},b)))}),d||this}}(jQuery,window,document); \ No newline at end of file diff --git a/admin/src/main/resources/static/library/bootstrap/bootstrap-icons.css b/admin/src/main/resources/static/library/bootstrap/bootstrap-icons.css new file mode 100644 index 00000000..cda9e700 --- /dev/null +++ b/admin/src/main/resources/static/library/bootstrap/bootstrap-icons.css @@ -0,0 +1,6752 @@ +@font-face { + font-family: "bootstrap-icons"; + src: url("icons/fonts/bootstrap-icons.woff2?524846017b983fc8ded9325d94ed40f3") format("woff2"), + url("icons/fonts/bootstrap-icons.woff?524846017b983fc8ded9325d94ed40f3") format("woff"); +} + +.bi::before, +[class^="bi-"]::before, +[class*=" bi-"]::before { + display: inline-block; + font-family: bootstrap-icons !important; + font-style: normal; + font-weight: normal !important; + font-variant: normal; + text-transform: none; + line-height: 1; + vertical-align: -.125em; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.bi-123::before { + content: "\f67f"; +} + +.bi-alarm-fill::before { + content: "\f101"; +} + +.bi-alarm::before { + content: "\f102"; +} + +.bi-align-bottom::before { + content: "\f103"; +} + +.bi-align-center::before { + content: "\f104"; +} + +.bi-align-end::before { + content: "\f105"; +} + +.bi-align-middle::before { + content: "\f106"; +} + +.bi-align-start::before { + content: "\f107"; +} + +.bi-align-top::before { + content: "\f108"; +} + +.bi-alt::before { + content: "\f109"; +} + +.bi-app-indicator::before { + content: "\f10a"; +} + +.bi-app::before { + content: "\f10b"; +} + +.bi-archive-fill::before { + content: "\f10c"; +} + +.bi-archive::before { + content: "\f10d"; +} + +.bi-arrow-90deg-down::before { + content: "\f10e"; +} + +.bi-arrow-90deg-left::before { + content: "\f10f"; +} + +.bi-arrow-90deg-right::before { + content: "\f110"; +} + +.bi-arrow-90deg-up::before { + content: "\f111"; +} + +.bi-arrow-bar-down::before { + content: "\f112"; +} + +.bi-arrow-bar-left::before { + content: "\f113"; +} + +.bi-arrow-bar-right::before { + content: "\f114"; +} + +.bi-arrow-bar-up::before { + content: "\f115"; +} + +.bi-arrow-clockwise::before { + content: "\f116"; +} + +.bi-arrow-counterclockwise::before { + content: "\f117"; +} + +.bi-arrow-down-circle-fill::before { + content: "\f118"; +} + +.bi-arrow-down-circle::before { + content: "\f119"; +} + +.bi-arrow-down-left-circle-fill::before { + content: "\f11a"; +} + +.bi-arrow-down-left-circle::before { + content: "\f11b"; +} + +.bi-arrow-down-left-square-fill::before { + content: "\f11c"; +} + +.bi-arrow-down-left-square::before { + content: "\f11d"; +} + +.bi-arrow-down-left::before { + content: "\f11e"; +} + +.bi-arrow-down-right-circle-fill::before { + content: "\f11f"; +} + +.bi-arrow-down-right-circle::before { + content: "\f120"; +} + +.bi-arrow-down-right-square-fill::before { + content: "\f121"; +} + +.bi-arrow-down-right-square::before { + content: "\f122"; +} + +.bi-arrow-down-right::before { + content: "\f123"; +} + +.bi-arrow-down-short::before { + content: "\f124"; +} + +.bi-arrow-down-square-fill::before { + content: "\f125"; +} + +.bi-arrow-down-square::before { + content: "\f126"; +} + +.bi-arrow-down-up::before { + content: "\f127"; +} + +.bi-arrow-down::before { + content: "\f128"; +} + +.bi-arrow-left-circle-fill::before { + content: "\f129"; +} + +.bi-arrow-left-circle::before { + content: "\f12a"; +} + +.bi-arrow-left-right::before { + content: "\f12b"; +} + +.bi-arrow-left-short::before { + content: "\f12c"; +} + +.bi-arrow-left-square-fill::before { + content: "\f12d"; +} + +.bi-arrow-left-square::before { + content: "\f12e"; +} + +.bi-arrow-left::before { + content: "\f12f"; +} + +.bi-arrow-repeat::before { + content: "\f130"; +} + +.bi-arrow-return-left::before { + content: "\f131"; +} + +.bi-arrow-return-right::before { + content: "\f132"; +} + +.bi-arrow-right-circle-fill::before { + content: "\f133"; +} + +.bi-arrow-right-circle::before { + content: "\f134"; +} + +.bi-arrow-right-short::before { + content: "\f135"; +} + +.bi-arrow-right-square-fill::before { + content: "\f136"; +} + +.bi-arrow-right-square::before { + content: "\f137"; +} + +.bi-arrow-right::before { + content: "\f138"; +} + +.bi-arrow-up-circle-fill::before { + content: "\f139"; +} + +.bi-arrow-up-circle::before { + content: "\f13a"; +} + +.bi-arrow-up-left-circle-fill::before { + content: "\f13b"; +} + +.bi-arrow-up-left-circle::before { + content: "\f13c"; +} + +.bi-arrow-up-left-square-fill::before { + content: "\f13d"; +} + +.bi-arrow-up-left-square::before { + content: "\f13e"; +} + +.bi-arrow-up-left::before { + content: "\f13f"; +} + +.bi-arrow-up-right-circle-fill::before { + content: "\f140"; +} + +.bi-arrow-up-right-circle::before { + content: "\f141"; +} + +.bi-arrow-up-right-square-fill::before { + content: "\f142"; +} + +.bi-arrow-up-right-square::before { + content: "\f143"; +} + +.bi-arrow-up-right::before { + content: "\f144"; +} + +.bi-arrow-up-short::before { + content: "\f145"; +} + +.bi-arrow-up-square-fill::before { + content: "\f146"; +} + +.bi-arrow-up-square::before { + content: "\f147"; +} + +.bi-arrow-up::before { + content: "\f148"; +} + +.bi-arrows-angle-contract::before { + content: "\f149"; +} + +.bi-arrows-angle-expand::before { + content: "\f14a"; +} + +.bi-arrows-collapse::before { + content: "\f14b"; +} + +.bi-arrows-expand::before { + content: "\f14c"; +} + +.bi-arrows-fullscreen::before { + content: "\f14d"; +} + +.bi-arrows-move::before { + content: "\f14e"; +} + +.bi-aspect-ratio-fill::before { + content: "\f14f"; +} + +.bi-aspect-ratio::before { + content: "\f150"; +} + +.bi-asterisk::before { + content: "\f151"; +} + +.bi-at::before { + content: "\f152"; +} + +.bi-award-fill::before { + content: "\f153"; +} + +.bi-award::before { + content: "\f154"; +} + +.bi-back::before { + content: "\f155"; +} + +.bi-backspace-fill::before { + content: "\f156"; +} + +.bi-backspace-reverse-fill::before { + content: "\f157"; +} + +.bi-backspace-reverse::before { + content: "\f158"; +} + +.bi-backspace::before { + content: "\f159"; +} + +.bi-badge-3d-fill::before { + content: "\f15a"; +} + +.bi-badge-3d::before { + content: "\f15b"; +} + +.bi-badge-4k-fill::before { + content: "\f15c"; +} + +.bi-badge-4k::before { + content: "\f15d"; +} + +.bi-badge-8k-fill::before { + content: "\f15e"; +} + +.bi-badge-8k::before { + content: "\f15f"; +} + +.bi-badge-ad-fill::before { + content: "\f160"; +} + +.bi-badge-ad::before { + content: "\f161"; +} + +.bi-badge-ar-fill::before { + content: "\f162"; +} + +.bi-badge-ar::before { + content: "\f163"; +} + +.bi-badge-cc-fill::before { + content: "\f164"; +} + +.bi-badge-cc::before { + content: "\f165"; +} + +.bi-badge-hd-fill::before { + content: "\f166"; +} + +.bi-badge-hd::before { + content: "\f167"; +} + +.bi-badge-tm-fill::before { + content: "\f168"; +} + +.bi-badge-tm::before { + content: "\f169"; +} + +.bi-badge-vo-fill::before { + content: "\f16a"; +} + +.bi-badge-vo::before { + content: "\f16b"; +} + +.bi-badge-vr-fill::before { + content: "\f16c"; +} + +.bi-badge-vr::before { + content: "\f16d"; +} + +.bi-badge-wc-fill::before { + content: "\f16e"; +} + +.bi-badge-wc::before { + content: "\f16f"; +} + +.bi-bag-check-fill::before { + content: "\f170"; +} + +.bi-bag-check::before { + content: "\f171"; +} + +.bi-bag-dash-fill::before { + content: "\f172"; +} + +.bi-bag-dash::before { + content: "\f173"; +} + +.bi-bag-fill::before { + content: "\f174"; +} + +.bi-bag-plus-fill::before { + content: "\f175"; +} + +.bi-bag-plus::before { + content: "\f176"; +} + +.bi-bag-x-fill::before { + content: "\f177"; +} + +.bi-bag-x::before { + content: "\f178"; +} + +.bi-bag::before { + content: "\f179"; +} + +.bi-bar-chart-fill::before { + content: "\f17a"; +} + +.bi-bar-chart-line-fill::before { + content: "\f17b"; +} + +.bi-bar-chart-line::before { + content: "\f17c"; +} + +.bi-bar-chart-steps::before { + content: "\f17d"; +} + +.bi-bar-chart::before { + content: "\f17e"; +} + +.bi-basket-fill::before { + content: "\f17f"; +} + +.bi-basket::before { + content: "\f180"; +} + +.bi-basket2-fill::before { + content: "\f181"; +} + +.bi-basket2::before { + content: "\f182"; +} + +.bi-basket3-fill::before { + content: "\f183"; +} + +.bi-basket3::before { + content: "\f184"; +} + +.bi-battery-charging::before { + content: "\f185"; +} + +.bi-battery-full::before { + content: "\f186"; +} + +.bi-battery-half::before { + content: "\f187"; +} + +.bi-battery::before { + content: "\f188"; +} + +.bi-bell-fill::before { + content: "\f189"; +} + +.bi-bell::before { + content: "\f18a"; +} + +.bi-bezier::before { + content: "\f18b"; +} + +.bi-bezier2::before { + content: "\f18c"; +} + +.bi-bicycle::before { + content: "\f18d"; +} + +.bi-binoculars-fill::before { + content: "\f18e"; +} + +.bi-binoculars::before { + content: "\f18f"; +} + +.bi-blockquote-left::before { + content: "\f190"; +} + +.bi-blockquote-right::before { + content: "\f191"; +} + +.bi-book-fill::before { + content: "\f192"; +} + +.bi-book-half::before { + content: "\f193"; +} + +.bi-book::before { + content: "\f194"; +} + +.bi-bookmark-check-fill::before { + content: "\f195"; +} + +.bi-bookmark-check::before { + content: "\f196"; +} + +.bi-bookmark-dash-fill::before { + content: "\f197"; +} + +.bi-bookmark-dash::before { + content: "\f198"; +} + +.bi-bookmark-fill::before { + content: "\f199"; +} + +.bi-bookmark-heart-fill::before { + content: "\f19a"; +} + +.bi-bookmark-heart::before { + content: "\f19b"; +} + +.bi-bookmark-plus-fill::before { + content: "\f19c"; +} + +.bi-bookmark-plus::before { + content: "\f19d"; +} + +.bi-bookmark-star-fill::before { + content: "\f19e"; +} + +.bi-bookmark-star::before { + content: "\f19f"; +} + +.bi-bookmark-x-fill::before { + content: "\f1a0"; +} + +.bi-bookmark-x::before { + content: "\f1a1"; +} + +.bi-bookmark::before { + content: "\f1a2"; +} + +.bi-bookmarks-fill::before { + content: "\f1a3"; +} + +.bi-bookmarks::before { + content: "\f1a4"; +} + +.bi-bookshelf::before { + content: "\f1a5"; +} + +.bi-bootstrap-fill::before { + content: "\f1a6"; +} + +.bi-bootstrap-reboot::before { + content: "\f1a7"; +} + +.bi-bootstrap::before { + content: "\f1a8"; +} + +.bi-border-all::before { + content: "\f1a9"; +} + +.bi-border-bottom::before { + content: "\f1aa"; +} + +.bi-border-center::before { + content: "\f1ab"; +} + +.bi-border-inner::before { + content: "\f1ac"; +} + +.bi-border-left::before { + content: "\f1ad"; +} + +.bi-border-middle::before { + content: "\f1ae"; +} + +.bi-border-outer::before { + content: "\f1af"; +} + +.bi-border-right::before { + content: "\f1b0"; +} + +.bi-border-style::before { + content: "\f1b1"; +} + +.bi-border-top::before { + content: "\f1b2"; +} + +.bi-border-width::before { + content: "\f1b3"; +} + +.bi-border::before { + content: "\f1b4"; +} + +.bi-bounding-box-circles::before { + content: "\f1b5"; +} + +.bi-bounding-box::before { + content: "\f1b6"; +} + +.bi-box-arrow-down-left::before { + content: "\f1b7"; +} + +.bi-box-arrow-down-right::before { + content: "\f1b8"; +} + +.bi-box-arrow-down::before { + content: "\f1b9"; +} + +.bi-box-arrow-in-down-left::before { + content: "\f1ba"; +} + +.bi-box-arrow-in-down-right::before { + content: "\f1bb"; +} + +.bi-box-arrow-in-down::before { + content: "\f1bc"; +} + +.bi-box-arrow-in-left::before { + content: "\f1bd"; +} + +.bi-box-arrow-in-right::before { + content: "\f1be"; +} + +.bi-box-arrow-in-up-left::before { + content: "\f1bf"; +} + +.bi-box-arrow-in-up-right::before { + content: "\f1c0"; +} + +.bi-box-arrow-in-up::before { + content: "\f1c1"; +} + +.bi-box-arrow-left::before { + content: "\f1c2"; +} + +.bi-box-arrow-right::before { + content: "\f1c3"; +} + +.bi-box-arrow-up-left::before { + content: "\f1c4"; +} + +.bi-box-arrow-up-right::before { + content: "\f1c5"; +} + +.bi-box-arrow-up::before { + content: "\f1c6"; +} + +.bi-box-seam::before { + content: "\f1c7"; +} + +.bi-box::before { + content: "\f1c8"; +} + +.bi-braces::before { + content: "\f1c9"; +} + +.bi-bricks::before { + content: "\f1ca"; +} + +.bi-briefcase-fill::before { + content: "\f1cb"; +} + +.bi-briefcase::before { + content: "\f1cc"; +} + +.bi-brightness-alt-high-fill::before { + content: "\f1cd"; +} + +.bi-brightness-alt-high::before { + content: "\f1ce"; +} + +.bi-brightness-alt-low-fill::before { + content: "\f1cf"; +} + +.bi-brightness-alt-low::before { + content: "\f1d0"; +} + +.bi-brightness-high-fill::before { + content: "\f1d1"; +} + +.bi-brightness-high::before { + content: "\f1d2"; +} + +.bi-brightness-low-fill::before { + content: "\f1d3"; +} + +.bi-brightness-low::before { + content: "\f1d4"; +} + +.bi-broadcast-pin::before { + content: "\f1d5"; +} + +.bi-broadcast::before { + content: "\f1d6"; +} + +.bi-brush-fill::before { + content: "\f1d7"; +} + +.bi-brush::before { + content: "\f1d8"; +} + +.bi-bucket-fill::before { + content: "\f1d9"; +} + +.bi-bucket::before { + content: "\f1da"; +} + +.bi-bug-fill::before { + content: "\f1db"; +} + +.bi-bug::before { + content: "\f1dc"; +} + +.bi-building::before { + content: "\f1dd"; +} + +.bi-bullseye::before { + content: "\f1de"; +} + +.bi-calculator-fill::before { + content: "\f1df"; +} + +.bi-calculator::before { + content: "\f1e0"; +} + +.bi-calendar-check-fill::before { + content: "\f1e1"; +} + +.bi-calendar-check::before { + content: "\f1e2"; +} + +.bi-calendar-date-fill::before { + content: "\f1e3"; +} + +.bi-calendar-date::before { + content: "\f1e4"; +} + +.bi-calendar-day-fill::before { + content: "\f1e5"; +} + +.bi-calendar-day::before { + content: "\f1e6"; +} + +.bi-calendar-event-fill::before { + content: "\f1e7"; +} + +.bi-calendar-event::before { + content: "\f1e8"; +} + +.bi-calendar-fill::before { + content: "\f1e9"; +} + +.bi-calendar-minus-fill::before { + content: "\f1ea"; +} + +.bi-calendar-minus::before { + content: "\f1eb"; +} + +.bi-calendar-month-fill::before { + content: "\f1ec"; +} + +.bi-calendar-month::before { + content: "\f1ed"; +} + +.bi-calendar-plus-fill::before { + content: "\f1ee"; +} + +.bi-calendar-plus::before { + content: "\f1ef"; +} + +.bi-calendar-range-fill::before { + content: "\f1f0"; +} + +.bi-calendar-range::before { + content: "\f1f1"; +} + +.bi-calendar-week-fill::before { + content: "\f1f2"; +} + +.bi-calendar-week::before { + content: "\f1f3"; +} + +.bi-calendar-x-fill::before { + content: "\f1f4"; +} + +.bi-calendar-x::before { + content: "\f1f5"; +} + +.bi-calendar::before { + content: "\f1f6"; +} + +.bi-calendar2-check-fill::before { + content: "\f1f7"; +} + +.bi-calendar2-check::before { + content: "\f1f8"; +} + +.bi-calendar2-date-fill::before { + content: "\f1f9"; +} + +.bi-calendar2-date::before { + content: "\f1fa"; +} + +.bi-calendar2-day-fill::before { + content: "\f1fb"; +} + +.bi-calendar2-day::before { + content: "\f1fc"; +} + +.bi-calendar2-event-fill::before { + content: "\f1fd"; +} + +.bi-calendar2-event::before { + content: "\f1fe"; +} + +.bi-calendar2-fill::before { + content: "\f1ff"; +} + +.bi-calendar2-minus-fill::before { + content: "\f200"; +} + +.bi-calendar2-minus::before { + content: "\f201"; +} + +.bi-calendar2-month-fill::before { + content: "\f202"; +} + +.bi-calendar2-month::before { + content: "\f203"; +} + +.bi-calendar2-plus-fill::before { + content: "\f204"; +} + +.bi-calendar2-plus::before { + content: "\f205"; +} + +.bi-calendar2-range-fill::before { + content: "\f206"; +} + +.bi-calendar2-range::before { + content: "\f207"; +} + +.bi-calendar2-week-fill::before { + content: "\f208"; +} + +.bi-calendar2-week::before { + content: "\f209"; +} + +.bi-calendar2-x-fill::before { + content: "\f20a"; +} + +.bi-calendar2-x::before { + content: "\f20b"; +} + +.bi-calendar2::before { + content: "\f20c"; +} + +.bi-calendar3-event-fill::before { + content: "\f20d"; +} + +.bi-calendar3-event::before { + content: "\f20e"; +} + +.bi-calendar3-fill::before { + content: "\f20f"; +} + +.bi-calendar3-range-fill::before { + content: "\f210"; +} + +.bi-calendar3-range::before { + content: "\f211"; +} + +.bi-calendar3-week-fill::before { + content: "\f212"; +} + +.bi-calendar3-week::before { + content: "\f213"; +} + +.bi-calendar3::before { + content: "\f214"; +} + +.bi-calendar4-event::before { + content: "\f215"; +} + +.bi-calendar4-range::before { + content: "\f216"; +} + +.bi-calendar4-week::before { + content: "\f217"; +} + +.bi-calendar4::before { + content: "\f218"; +} + +.bi-camera-fill::before { + content: "\f219"; +} + +.bi-camera-reels-fill::before { + content: "\f21a"; +} + +.bi-camera-reels::before { + content: "\f21b"; +} + +.bi-camera-video-fill::before { + content: "\f21c"; +} + +.bi-camera-video-off-fill::before { + content: "\f21d"; +} + +.bi-camera-video-off::before { + content: "\f21e"; +} + +.bi-camera-video::before { + content: "\f21f"; +} + +.bi-camera::before { + content: "\f220"; +} + +.bi-camera2::before { + content: "\f221"; +} + +.bi-capslock-fill::before { + content: "\f222"; +} + +.bi-capslock::before { + content: "\f223"; +} + +.bi-card-checklist::before { + content: "\f224"; +} + +.bi-card-heading::before { + content: "\f225"; +} + +.bi-card-image::before { + content: "\f226"; +} + +.bi-card-list::before { + content: "\f227"; +} + +.bi-card-text::before { + content: "\f228"; +} + +.bi-caret-down-fill::before { + content: "\f229"; +} + +.bi-caret-down-square-fill::before { + content: "\f22a"; +} + +.bi-caret-down-square::before { + content: "\f22b"; +} + +.bi-caret-down::before { + content: "\f22c"; +} + +.bi-caret-left-fill::before { + content: "\f22d"; +} + +.bi-caret-left-square-fill::before { + content: "\f22e"; +} + +.bi-caret-left-square::before { + content: "\f22f"; +} + +.bi-caret-left::before { + content: "\f230"; +} + +.bi-caret-right-fill::before { + content: "\f231"; +} + +.bi-caret-right-square-fill::before { + content: "\f232"; +} + +.bi-caret-right-square::before { + content: "\f233"; +} + +.bi-caret-right::before { + content: "\f234"; +} + +.bi-caret-up-fill::before { + content: "\f235"; +} + +.bi-caret-up-square-fill::before { + content: "\f236"; +} + +.bi-caret-up-square::before { + content: "\f237"; +} + +.bi-caret-up::before { + content: "\f238"; +} + +.bi-cart-check-fill::before { + content: "\f239"; +} + +.bi-cart-check::before { + content: "\f23a"; +} + +.bi-cart-dash-fill::before { + content: "\f23b"; +} + +.bi-cart-dash::before { + content: "\f23c"; +} + +.bi-cart-fill::before { + content: "\f23d"; +} + +.bi-cart-plus-fill::before { + content: "\f23e"; +} + +.bi-cart-plus::before { + content: "\f23f"; +} + +.bi-cart-x-fill::before { + content: "\f240"; +} + +.bi-cart-x::before { + content: "\f241"; +} + +.bi-cart::before { + content: "\f242"; +} + +.bi-cart2::before { + content: "\f243"; +} + +.bi-cart3::before { + content: "\f244"; +} + +.bi-cart4::before { + content: "\f245"; +} + +.bi-cash-stack::before { + content: "\f246"; +} + +.bi-cash::before { + content: "\f247"; +} + +.bi-cast::before { + content: "\f248"; +} + +.bi-chat-dots-fill::before { + content: "\f249"; +} + +.bi-chat-dots::before { + content: "\f24a"; +} + +.bi-chat-fill::before { + content: "\f24b"; +} + +.bi-chat-left-dots-fill::before { + content: "\f24c"; +} + +.bi-chat-left-dots::before { + content: "\f24d"; +} + +.bi-chat-left-fill::before { + content: "\f24e"; +} + +.bi-chat-left-quote-fill::before { + content: "\f24f"; +} + +.bi-chat-left-quote::before { + content: "\f250"; +} + +.bi-chat-left-text-fill::before { + content: "\f251"; +} + +.bi-chat-left-text::before { + content: "\f252"; +} + +.bi-chat-left::before { + content: "\f253"; +} + +.bi-chat-quote-fill::before { + content: "\f254"; +} + +.bi-chat-quote::before { + content: "\f255"; +} + +.bi-chat-right-dots-fill::before { + content: "\f256"; +} + +.bi-chat-right-dots::before { + content: "\f257"; +} + +.bi-chat-right-fill::before { + content: "\f258"; +} + +.bi-chat-right-quote-fill::before { + content: "\f259"; +} + +.bi-chat-right-quote::before { + content: "\f25a"; +} + +.bi-chat-right-text-fill::before { + content: "\f25b"; +} + +.bi-chat-right-text::before { + content: "\f25c"; +} + +.bi-chat-right::before { + content: "\f25d"; +} + +.bi-chat-square-dots-fill::before { + content: "\f25e"; +} + +.bi-chat-square-dots::before { + content: "\f25f"; +} + +.bi-chat-square-fill::before { + content: "\f260"; +} + +.bi-chat-square-quote-fill::before { + content: "\f261"; +} + +.bi-chat-square-quote::before { + content: "\f262"; +} + +.bi-chat-square-text-fill::before { + content: "\f263"; +} + +.bi-chat-square-text::before { + content: "\f264"; +} + +.bi-chat-square::before { + content: "\f265"; +} + +.bi-chat-text-fill::before { + content: "\f266"; +} + +.bi-chat-text::before { + content: "\f267"; +} + +.bi-chat::before { + content: "\f268"; +} + +.bi-check-all::before { + content: "\f269"; +} + +.bi-check-circle-fill::before { + content: "\f26a"; +} + +.bi-check-circle::before { + content: "\f26b"; +} + +.bi-check-square-fill::before { + content: "\f26c"; +} + +.bi-check-square::before { + content: "\f26d"; +} + +.bi-check::before { + content: "\f26e"; +} + +.bi-check2-all::before { + content: "\f26f"; +} + +.bi-check2-circle::before { + content: "\f270"; +} + +.bi-check2-square::before { + content: "\f271"; +} + +.bi-check2::before { + content: "\f272"; +} + +.bi-chevron-bar-contract::before { + content: "\f273"; +} + +.bi-chevron-bar-down::before { + content: "\f274"; +} + +.bi-chevron-bar-expand::before { + content: "\f275"; +} + +.bi-chevron-bar-left::before { + content: "\f276"; +} + +.bi-chevron-bar-right::before { + content: "\f277"; +} + +.bi-chevron-bar-up::before { + content: "\f278"; +} + +.bi-chevron-compact-down::before { + content: "\f279"; +} + +.bi-chevron-compact-left::before { + content: "\f27a"; +} + +.bi-chevron-compact-right::before { + content: "\f27b"; +} + +.bi-chevron-compact-up::before { + content: "\f27c"; +} + +.bi-chevron-contract::before { + content: "\f27d"; +} + +.bi-chevron-double-down::before { + content: "\f27e"; +} + +.bi-chevron-double-left::before { + content: "\f27f"; +} + +.bi-chevron-double-right::before { + content: "\f280"; +} + +.bi-chevron-double-up::before { + content: "\f281"; +} + +.bi-chevron-down::before { + content: "\f282"; +} + +.bi-chevron-expand::before { + content: "\f283"; +} + +.bi-chevron-left::before { + content: "\f284"; +} + +.bi-chevron-right::before { + content: "\f285"; +} + +.bi-chevron-up::before { + content: "\f286"; +} + +.bi-circle-fill::before { + content: "\f287"; +} + +.bi-circle-half::before { + content: "\f288"; +} + +.bi-circle-square::before { + content: "\f289"; +} + +.bi-circle::before { + content: "\f28a"; +} + +.bi-clipboard-check::before { + content: "\f28b"; +} + +.bi-clipboard-data::before { + content: "\f28c"; +} + +.bi-clipboard-minus::before { + content: "\f28d"; +} + +.bi-clipboard-plus::before { + content: "\f28e"; +} + +.bi-clipboard-x::before { + content: "\f28f"; +} + +.bi-clipboard::before { + content: "\f290"; +} + +.bi-clock-fill::before { + content: "\f291"; +} + +.bi-clock-history::before { + content: "\f292"; +} + +.bi-clock::before { + content: "\f293"; +} + +.bi-cloud-arrow-down-fill::before { + content: "\f294"; +} + +.bi-cloud-arrow-down::before { + content: "\f295"; +} + +.bi-cloud-arrow-up-fill::before { + content: "\f296"; +} + +.bi-cloud-arrow-up::before { + content: "\f297"; +} + +.bi-cloud-check-fill::before { + content: "\f298"; +} + +.bi-cloud-check::before { + content: "\f299"; +} + +.bi-cloud-download-fill::before { + content: "\f29a"; +} + +.bi-cloud-download::before { + content: "\f29b"; +} + +.bi-cloud-drizzle-fill::before { + content: "\f29c"; +} + +.bi-cloud-drizzle::before { + content: "\f29d"; +} + +.bi-cloud-fill::before { + content: "\f29e"; +} + +.bi-cloud-fog-fill::before { + content: "\f29f"; +} + +.bi-cloud-fog::before { + content: "\f2a0"; +} + +.bi-cloud-fog2-fill::before { + content: "\f2a1"; +} + +.bi-cloud-fog2::before { + content: "\f2a2"; +} + +.bi-cloud-hail-fill::before { + content: "\f2a3"; +} + +.bi-cloud-hail::before { + content: "\f2a4"; +} + +.bi-cloud-haze-1::before { + content: "\f2a5"; +} + +.bi-cloud-haze-fill::before { + content: "\f2a6"; +} + +.bi-cloud-haze::before { + content: "\f2a7"; +} + +.bi-cloud-haze2-fill::before { + content: "\f2a8"; +} + +.bi-cloud-lightning-fill::before { + content: "\f2a9"; +} + +.bi-cloud-lightning-rain-fill::before { + content: "\f2aa"; +} + +.bi-cloud-lightning-rain::before { + content: "\f2ab"; +} + +.bi-cloud-lightning::before { + content: "\f2ac"; +} + +.bi-cloud-minus-fill::before { + content: "\f2ad"; +} + +.bi-cloud-minus::before { + content: "\f2ae"; +} + +.bi-cloud-moon-fill::before { + content: "\f2af"; +} + +.bi-cloud-moon::before { + content: "\f2b0"; +} + +.bi-cloud-plus-fill::before { + content: "\f2b1"; +} + +.bi-cloud-plus::before { + content: "\f2b2"; +} + +.bi-cloud-rain-fill::before { + content: "\f2b3"; +} + +.bi-cloud-rain-heavy-fill::before { + content: "\f2b4"; +} + +.bi-cloud-rain-heavy::before { + content: "\f2b5"; +} + +.bi-cloud-rain::before { + content: "\f2b6"; +} + +.bi-cloud-slash-fill::before { + content: "\f2b7"; +} + +.bi-cloud-slash::before { + content: "\f2b8"; +} + +.bi-cloud-sleet-fill::before { + content: "\f2b9"; +} + +.bi-cloud-sleet::before { + content: "\f2ba"; +} + +.bi-cloud-snow-fill::before { + content: "\f2bb"; +} + +.bi-cloud-snow::before { + content: "\f2bc"; +} + +.bi-cloud-sun-fill::before { + content: "\f2bd"; +} + +.bi-cloud-sun::before { + content: "\f2be"; +} + +.bi-cloud-upload-fill::before { + content: "\f2bf"; +} + +.bi-cloud-upload::before { + content: "\f2c0"; +} + +.bi-cloud::before { + content: "\f2c1"; +} + +.bi-clouds-fill::before { + content: "\f2c2"; +} + +.bi-clouds::before { + content: "\f2c3"; +} + +.bi-cloudy-fill::before { + content: "\f2c4"; +} + +.bi-cloudy::before { + content: "\f2c5"; +} + +.bi-code-slash::before { + content: "\f2c6"; +} + +.bi-code-square::before { + content: "\f2c7"; +} + +.bi-code::before { + content: "\f2c8"; +} + +.bi-collection-fill::before { + content: "\f2c9"; +} + +.bi-collection-play-fill::before { + content: "\f2ca"; +} + +.bi-collection-play::before { + content: "\f2cb"; +} + +.bi-collection::before { + content: "\f2cc"; +} + +.bi-columns-gap::before { + content: "\f2cd"; +} + +.bi-columns::before { + content: "\f2ce"; +} + +.bi-command::before { + content: "\f2cf"; +} + +.bi-compass-fill::before { + content: "\f2d0"; +} + +.bi-compass::before { + content: "\f2d1"; +} + +.bi-cone-striped::before { + content: "\f2d2"; +} + +.bi-cone::before { + content: "\f2d3"; +} + +.bi-controller::before { + content: "\f2d4"; +} + +.bi-cpu-fill::before { + content: "\f2d5"; +} + +.bi-cpu::before { + content: "\f2d6"; +} + +.bi-credit-card-2-back-fill::before { + content: "\f2d7"; +} + +.bi-credit-card-2-back::before { + content: "\f2d8"; +} + +.bi-credit-card-2-front-fill::before { + content: "\f2d9"; +} + +.bi-credit-card-2-front::before { + content: "\f2da"; +} + +.bi-credit-card-fill::before { + content: "\f2db"; +} + +.bi-credit-card::before { + content: "\f2dc"; +} + +.bi-crop::before { + content: "\f2dd"; +} + +.bi-cup-fill::before { + content: "\f2de"; +} + +.bi-cup-straw::before { + content: "\f2df"; +} + +.bi-cup::before { + content: "\f2e0"; +} + +.bi-cursor-fill::before { + content: "\f2e1"; +} + +.bi-cursor-text::before { + content: "\f2e2"; +} + +.bi-cursor::before { + content: "\f2e3"; +} + +.bi-dash-circle-dotted::before { + content: "\f2e4"; +} + +.bi-dash-circle-fill::before { + content: "\f2e5"; +} + +.bi-dash-circle::before { + content: "\f2e6"; +} + +.bi-dash-square-dotted::before { + content: "\f2e7"; +} + +.bi-dash-square-fill::before { + content: "\f2e8"; +} + +.bi-dash-square::before { + content: "\f2e9"; +} + +.bi-dash::before { + content: "\f2ea"; +} + +.bi-diagram-2-fill::before { + content: "\f2eb"; +} + +.bi-diagram-2::before { + content: "\f2ec"; +} + +.bi-diagram-3-fill::before { + content: "\f2ed"; +} + +.bi-diagram-3::before { + content: "\f2ee"; +} + +.bi-diamond-fill::before { + content: "\f2ef"; +} + +.bi-diamond-half::before { + content: "\f2f0"; +} + +.bi-diamond::before { + content: "\f2f1"; +} + +.bi-dice-1-fill::before { + content: "\f2f2"; +} + +.bi-dice-1::before { + content: "\f2f3"; +} + +.bi-dice-2-fill::before { + content: "\f2f4"; +} + +.bi-dice-2::before { + content: "\f2f5"; +} + +.bi-dice-3-fill::before { + content: "\f2f6"; +} + +.bi-dice-3::before { + content: "\f2f7"; +} + +.bi-dice-4-fill::before { + content: "\f2f8"; +} + +.bi-dice-4::before { + content: "\f2f9"; +} + +.bi-dice-5-fill::before { + content: "\f2fa"; +} + +.bi-dice-5::before { + content: "\f2fb"; +} + +.bi-dice-6-fill::before { + content: "\f2fc"; +} + +.bi-dice-6::before { + content: "\f2fd"; +} + +.bi-disc-fill::before { + content: "\f2fe"; +} + +.bi-disc::before { + content: "\f2ff"; +} + +.bi-discord::before { + content: "\f300"; +} + +.bi-display-fill::before { + content: "\f301"; +} + +.bi-display::before { + content: "\f302"; +} + +.bi-distribute-horizontal::before { + content: "\f303"; +} + +.bi-distribute-vertical::before { + content: "\f304"; +} + +.bi-door-closed-fill::before { + content: "\f305"; +} + +.bi-door-closed::before { + content: "\f306"; +} + +.bi-door-open-fill::before { + content: "\f307"; +} + +.bi-door-open::before { + content: "\f308"; +} + +.bi-dot::before { + content: "\f309"; +} + +.bi-download::before { + content: "\f30a"; +} + +.bi-droplet-fill::before { + content: "\f30b"; +} + +.bi-droplet-half::before { + content: "\f30c"; +} + +.bi-droplet::before { + content: "\f30d"; +} + +.bi-earbuds::before { + content: "\f30e"; +} + +.bi-easel-fill::before { + content: "\f30f"; +} + +.bi-easel::before { + content: "\f310"; +} + +.bi-egg-fill::before { + content: "\f311"; +} + +.bi-egg-fried::before { + content: "\f312"; +} + +.bi-egg::before { + content: "\f313"; +} + +.bi-eject-fill::before { + content: "\f314"; +} + +.bi-eject::before { + content: "\f315"; +} + +.bi-emoji-angry-fill::before { + content: "\f316"; +} + +.bi-emoji-angry::before { + content: "\f317"; +} + +.bi-emoji-dizzy-fill::before { + content: "\f318"; +} + +.bi-emoji-dizzy::before { + content: "\f319"; +} + +.bi-emoji-expressionless-fill::before { + content: "\f31a"; +} + +.bi-emoji-expressionless::before { + content: "\f31b"; +} + +.bi-emoji-frown-fill::before { + content: "\f31c"; +} + +.bi-emoji-frown::before { + content: "\f31d"; +} + +.bi-emoji-heart-eyes-fill::before { + content: "\f31e"; +} + +.bi-emoji-heart-eyes::before { + content: "\f31f"; +} + +.bi-emoji-laughing-fill::before { + content: "\f320"; +} + +.bi-emoji-laughing::before { + content: "\f321"; +} + +.bi-emoji-neutral-fill::before { + content: "\f322"; +} + +.bi-emoji-neutral::before { + content: "\f323"; +} + +.bi-emoji-smile-fill::before { + content: "\f324"; +} + +.bi-emoji-smile-upside-down-fill::before { + content: "\f325"; +} + +.bi-emoji-smile-upside-down::before { + content: "\f326"; +} + +.bi-emoji-smile::before { + content: "\f327"; +} + +.bi-emoji-sunglasses-fill::before { + content: "\f328"; +} + +.bi-emoji-sunglasses::before { + content: "\f329"; +} + +.bi-emoji-wink-fill::before { + content: "\f32a"; +} + +.bi-emoji-wink::before { + content: "\f32b"; +} + +.bi-envelope-fill::before { + content: "\f32c"; +} + +.bi-envelope-open-fill::before { + content: "\f32d"; +} + +.bi-envelope-open::before { + content: "\f32e"; +} + +.bi-envelope::before { + content: "\f32f"; +} + +.bi-eraser-fill::before { + content: "\f330"; +} + +.bi-eraser::before { + content: "\f331"; +} + +.bi-exclamation-circle-fill::before { + content: "\f332"; +} + +.bi-exclamation-circle::before { + content: "\f333"; +} + +.bi-exclamation-diamond-fill::before { + content: "\f334"; +} + +.bi-exclamation-diamond::before { + content: "\f335"; +} + +.bi-exclamation-octagon-fill::before { + content: "\f336"; +} + +.bi-exclamation-octagon::before { + content: "\f337"; +} + +.bi-exclamation-square-fill::before { + content: "\f338"; +} + +.bi-exclamation-square::before { + content: "\f339"; +} + +.bi-exclamation-triangle-fill::before { + content: "\f33a"; +} + +.bi-exclamation-triangle::before { + content: "\f33b"; +} + +.bi-exclamation::before { + content: "\f33c"; +} + +.bi-exclude::before { + content: "\f33d"; +} + +.bi-eye-fill::before { + content: "\f33e"; +} + +.bi-eye-slash-fill::before { + content: "\f33f"; +} + +.bi-eye-slash::before { + content: "\f340"; +} + +.bi-eye::before { + content: "\f341"; +} + +.bi-eyedropper::before { + content: "\f342"; +} + +.bi-eyeglasses::before { + content: "\f343"; +} + +.bi-facebook::before { + content: "\f344"; +} + +.bi-file-arrow-down-fill::before { + content: "\f345"; +} + +.bi-file-arrow-down::before { + content: "\f346"; +} + +.bi-file-arrow-up-fill::before { + content: "\f347"; +} + +.bi-file-arrow-up::before { + content: "\f348"; +} + +.bi-file-bar-graph-fill::before { + content: "\f349"; +} + +.bi-file-bar-graph::before { + content: "\f34a"; +} + +.bi-file-binary-fill::before { + content: "\f34b"; +} + +.bi-file-binary::before { + content: "\f34c"; +} + +.bi-file-break-fill::before { + content: "\f34d"; +} + +.bi-file-break::before { + content: "\f34e"; +} + +.bi-file-check-fill::before { + content: "\f34f"; +} + +.bi-file-check::before { + content: "\f350"; +} + +.bi-file-code-fill::before { + content: "\f351"; +} + +.bi-file-code::before { + content: "\f352"; +} + +.bi-file-diff-fill::before { + content: "\f353"; +} + +.bi-file-diff::before { + content: "\f354"; +} + +.bi-file-earmark-arrow-down-fill::before { + content: "\f355"; +} + +.bi-file-earmark-arrow-down::before { + content: "\f356"; +} + +.bi-file-earmark-arrow-up-fill::before { + content: "\f357"; +} + +.bi-file-earmark-arrow-up::before { + content: "\f358"; +} + +.bi-file-earmark-bar-graph-fill::before { + content: "\f359"; +} + +.bi-file-earmark-bar-graph::before { + content: "\f35a"; +} + +.bi-file-earmark-binary-fill::before { + content: "\f35b"; +} + +.bi-file-earmark-binary::before { + content: "\f35c"; +} + +.bi-file-earmark-break-fill::before { + content: "\f35d"; +} + +.bi-file-earmark-break::before { + content: "\f35e"; +} + +.bi-file-earmark-check-fill::before { + content: "\f35f"; +} + +.bi-file-earmark-check::before { + content: "\f360"; +} + +.bi-file-earmark-code-fill::before { + content: "\f361"; +} + +.bi-file-earmark-code::before { + content: "\f362"; +} + +.bi-file-earmark-diff-fill::before { + content: "\f363"; +} + +.bi-file-earmark-diff::before { + content: "\f364"; +} + +.bi-file-earmark-easel-fill::before { + content: "\f365"; +} + +.bi-file-earmark-easel::before { + content: "\f366"; +} + +.bi-file-earmark-excel-fill::before { + content: "\f367"; +} + +.bi-file-earmark-excel::before { + content: "\f368"; +} + +.bi-file-earmark-fill::before { + content: "\f369"; +} + +.bi-file-earmark-font-fill::before { + content: "\f36a"; +} + +.bi-file-earmark-font::before { + content: "\f36b"; +} + +.bi-file-earmark-image-fill::before { + content: "\f36c"; +} + +.bi-file-earmark-image::before { + content: "\f36d"; +} + +.bi-file-earmark-lock-fill::before { + content: "\f36e"; +} + +.bi-file-earmark-lock::before { + content: "\f36f"; +} + +.bi-file-earmark-lock2-fill::before { + content: "\f370"; +} + +.bi-file-earmark-lock2::before { + content: "\f371"; +} + +.bi-file-earmark-medical-fill::before { + content: "\f372"; +} + +.bi-file-earmark-medical::before { + content: "\f373"; +} + +.bi-file-earmark-minus-fill::before { + content: "\f374"; +} + +.bi-file-earmark-minus::before { + content: "\f375"; +} + +.bi-file-earmark-music-fill::before { + content: "\f376"; +} + +.bi-file-earmark-music::before { + content: "\f377"; +} + +.bi-file-earmark-person-fill::before { + content: "\f378"; +} + +.bi-file-earmark-person::before { + content: "\f379"; +} + +.bi-file-earmark-play-fill::before { + content: "\f37a"; +} + +.bi-file-earmark-play::before { + content: "\f37b"; +} + +.bi-file-earmark-plus-fill::before { + content: "\f37c"; +} + +.bi-file-earmark-plus::before { + content: "\f37d"; +} + +.bi-file-earmark-post-fill::before { + content: "\f37e"; +} + +.bi-file-earmark-post::before { + content: "\f37f"; +} + +.bi-file-earmark-ppt-fill::before { + content: "\f380"; +} + +.bi-file-earmark-ppt::before { + content: "\f381"; +} + +.bi-file-earmark-richtext-fill::before { + content: "\f382"; +} + +.bi-file-earmark-richtext::before { + content: "\f383"; +} + +.bi-file-earmark-ruled-fill::before { + content: "\f384"; +} + +.bi-file-earmark-ruled::before { + content: "\f385"; +} + +.bi-file-earmark-slides-fill::before { + content: "\f386"; +} + +.bi-file-earmark-slides::before { + content: "\f387"; +} + +.bi-file-earmark-spreadsheet-fill::before { + content: "\f388"; +} + +.bi-file-earmark-spreadsheet::before { + content: "\f389"; +} + +.bi-file-earmark-text-fill::before { + content: "\f38a"; +} + +.bi-file-earmark-text::before { + content: "\f38b"; +} + +.bi-file-earmark-word-fill::before { + content: "\f38c"; +} + +.bi-file-earmark-word::before { + content: "\f38d"; +} + +.bi-file-earmark-x-fill::before { + content: "\f38e"; +} + +.bi-file-earmark-x::before { + content: "\f38f"; +} + +.bi-file-earmark-zip-fill::before { + content: "\f390"; +} + +.bi-file-earmark-zip::before { + content: "\f391"; +} + +.bi-file-earmark::before { + content: "\f392"; +} + +.bi-file-easel-fill::before { + content: "\f393"; +} + +.bi-file-easel::before { + content: "\f394"; +} + +.bi-file-excel-fill::before { + content: "\f395"; +} + +.bi-file-excel::before { + content: "\f396"; +} + +.bi-file-fill::before { + content: "\f397"; +} + +.bi-file-font-fill::before { + content: "\f398"; +} + +.bi-file-font::before { + content: "\f399"; +} + +.bi-file-image-fill::before { + content: "\f39a"; +} + +.bi-file-image::before { + content: "\f39b"; +} + +.bi-file-lock-fill::before { + content: "\f39c"; +} + +.bi-file-lock::before { + content: "\f39d"; +} + +.bi-file-lock2-fill::before { + content: "\f39e"; +} + +.bi-file-lock2::before { + content: "\f39f"; +} + +.bi-file-medical-fill::before { + content: "\f3a0"; +} + +.bi-file-medical::before { + content: "\f3a1"; +} + +.bi-file-minus-fill::before { + content: "\f3a2"; +} + +.bi-file-minus::before { + content: "\f3a3"; +} + +.bi-file-music-fill::before { + content: "\f3a4"; +} + +.bi-file-music::before { + content: "\f3a5"; +} + +.bi-file-person-fill::before { + content: "\f3a6"; +} + +.bi-file-person::before { + content: "\f3a7"; +} + +.bi-file-play-fill::before { + content: "\f3a8"; +} + +.bi-file-play::before { + content: "\f3a9"; +} + +.bi-file-plus-fill::before { + content: "\f3aa"; +} + +.bi-file-plus::before { + content: "\f3ab"; +} + +.bi-file-post-fill::before { + content: "\f3ac"; +} + +.bi-file-post::before { + content: "\f3ad"; +} + +.bi-file-ppt-fill::before { + content: "\f3ae"; +} + +.bi-file-ppt::before { + content: "\f3af"; +} + +.bi-file-richtext-fill::before { + content: "\f3b0"; +} + +.bi-file-richtext::before { + content: "\f3b1"; +} + +.bi-file-ruled-fill::before { + content: "\f3b2"; +} + +.bi-file-ruled::before { + content: "\f3b3"; +} + +.bi-file-slides-fill::before { + content: "\f3b4"; +} + +.bi-file-slides::before { + content: "\f3b5"; +} + +.bi-file-spreadsheet-fill::before { + content: "\f3b6"; +} + +.bi-file-spreadsheet::before { + content: "\f3b7"; +} + +.bi-file-text-fill::before { + content: "\f3b8"; +} + +.bi-file-text::before { + content: "\f3b9"; +} + +.bi-file-word-fill::before { + content: "\f3ba"; +} + +.bi-file-word::before { + content: "\f3bb"; +} + +.bi-file-x-fill::before { + content: "\f3bc"; +} + +.bi-file-x::before { + content: "\f3bd"; +} + +.bi-file-zip-fill::before { + content: "\f3be"; +} + +.bi-file-zip::before { + content: "\f3bf"; +} + +.bi-file::before { + content: "\f3c0"; +} + +.bi-files-alt::before { + content: "\f3c1"; +} + +.bi-files::before { + content: "\f3c2"; +} + +.bi-film::before { + content: "\f3c3"; +} + +.bi-filter-circle-fill::before { + content: "\f3c4"; +} + +.bi-filter-circle::before { + content: "\f3c5"; +} + +.bi-filter-left::before { + content: "\f3c6"; +} + +.bi-filter-right::before { + content: "\f3c7"; +} + +.bi-filter-square-fill::before { + content: "\f3c8"; +} + +.bi-filter-square::before { + content: "\f3c9"; +} + +.bi-filter::before { + content: "\f3ca"; +} + +.bi-flag-fill::before { + content: "\f3cb"; +} + +.bi-flag::before { + content: "\f3cc"; +} + +.bi-flower1::before { + content: "\f3cd"; +} + +.bi-flower2::before { + content: "\f3ce"; +} + +.bi-flower3::before { + content: "\f3cf"; +} + +.bi-folder-check::before { + content: "\f3d0"; +} + +.bi-folder-fill::before { + content: "\f3d1"; +} + +.bi-folder-minus::before { + content: "\f3d2"; +} + +.bi-folder-plus::before { + content: "\f3d3"; +} + +.bi-folder-symlink-fill::before { + content: "\f3d4"; +} + +.bi-folder-symlink::before { + content: "\f3d5"; +} + +.bi-folder-x::before { + content: "\f3d6"; +} + +.bi-folder::before { + content: "\f3d7"; +} + +.bi-folder2-open::before { + content: "\f3d8"; +} + +.bi-folder2::before { + content: "\f3d9"; +} + +.bi-fonts::before { + content: "\f3da"; +} + +.bi-forward-fill::before { + content: "\f3db"; +} + +.bi-forward::before { + content: "\f3dc"; +} + +.bi-front::before { + content: "\f3dd"; +} + +.bi-fullscreen-exit::before { + content: "\f3de"; +} + +.bi-fullscreen::before { + content: "\f3df"; +} + +.bi-funnel-fill::before { + content: "\f3e0"; +} + +.bi-funnel::before { + content: "\f3e1"; +} + +.bi-gear-fill::before { + content: "\f3e2"; +} + +.bi-gear-wide-connected::before { + content: "\f3e3"; +} + +.bi-gear-wide::before { + content: "\f3e4"; +} + +.bi-gear::before { + content: "\f3e5"; +} + +.bi-gem::before { + content: "\f3e6"; +} + +.bi-geo-alt-fill::before { + content: "\f3e7"; +} + +.bi-geo-alt::before { + content: "\f3e8"; +} + +.bi-geo-fill::before { + content: "\f3e9"; +} + +.bi-geo::before { + content: "\f3ea"; +} + +.bi-gift-fill::before { + content: "\f3eb"; +} + +.bi-gift::before { + content: "\f3ec"; +} + +.bi-github::before { + content: "\f3ed"; +} + +.bi-globe::before { + content: "\f3ee"; +} + +.bi-globe2::before { + content: "\f3ef"; +} + +.bi-google::before { + content: "\f3f0"; +} + +.bi-graph-down::before { + content: "\f3f1"; +} + +.bi-graph-up::before { + content: "\f3f2"; +} + +.bi-grid-1x2-fill::before { + content: "\f3f3"; +} + +.bi-grid-1x2::before { + content: "\f3f4"; +} + +.bi-grid-3x2-gap-fill::before { + content: "\f3f5"; +} + +.bi-grid-3x2-gap::before { + content: "\f3f6"; +} + +.bi-grid-3x2::before { + content: "\f3f7"; +} + +.bi-grid-3x3-gap-fill::before { + content: "\f3f8"; +} + +.bi-grid-3x3-gap::before { + content: "\f3f9"; +} + +.bi-grid-3x3::before { + content: "\f3fa"; +} + +.bi-grid-fill::before { + content: "\f3fb"; +} + +.bi-grid::before { + content: "\f3fc"; +} + +.bi-grip-horizontal::before { + content: "\f3fd"; +} + +.bi-grip-vertical::before { + content: "\f3fe"; +} + +.bi-hammer::before { + content: "\f3ff"; +} + +.bi-hand-index-fill::before { + content: "\f400"; +} + +.bi-hand-index-thumb-fill::before { + content: "\f401"; +} + +.bi-hand-index-thumb::before { + content: "\f402"; +} + +.bi-hand-index::before { + content: "\f403"; +} + +.bi-hand-thumbs-down-fill::before { + content: "\f404"; +} + +.bi-hand-thumbs-down::before { + content: "\f405"; +} + +.bi-hand-thumbs-up-fill::before { + content: "\f406"; +} + +.bi-hand-thumbs-up::before { + content: "\f407"; +} + +.bi-handbag-fill::before { + content: "\f408"; +} + +.bi-handbag::before { + content: "\f409"; +} + +.bi-hash::before { + content: "\f40a"; +} + +.bi-hdd-fill::before { + content: "\f40b"; +} + +.bi-hdd-network-fill::before { + content: "\f40c"; +} + +.bi-hdd-network::before { + content: "\f40d"; +} + +.bi-hdd-rack-fill::before { + content: "\f40e"; +} + +.bi-hdd-rack::before { + content: "\f40f"; +} + +.bi-hdd-stack-fill::before { + content: "\f410"; +} + +.bi-hdd-stack::before { + content: "\f411"; +} + +.bi-hdd::before { + content: "\f412"; +} + +.bi-headphones::before { + content: "\f413"; +} + +.bi-headset::before { + content: "\f414"; +} + +.bi-heart-fill::before { + content: "\f415"; +} + +.bi-heart-half::before { + content: "\f416"; +} + +.bi-heart::before { + content: "\f417"; +} + +.bi-heptagon-fill::before { + content: "\f418"; +} + +.bi-heptagon-half::before { + content: "\f419"; +} + +.bi-heptagon::before { + content: "\f41a"; +} + +.bi-hexagon-fill::before { + content: "\f41b"; +} + +.bi-hexagon-half::before { + content: "\f41c"; +} + +.bi-hexagon::before { + content: "\f41d"; +} + +.bi-hourglass-bottom::before { + content: "\f41e"; +} + +.bi-hourglass-split::before { + content: "\f41f"; +} + +.bi-hourglass-top::before { + content: "\f420"; +} + +.bi-hourglass::before { + content: "\f421"; +} + +.bi-house-door-fill::before { + content: "\f422"; +} + +.bi-house-door::before { + content: "\f423"; +} + +.bi-house-fill::before { + content: "\f424"; +} + +.bi-house::before { + content: "\f425"; +} + +.bi-hr::before { + content: "\f426"; +} + +.bi-hurricane::before { + content: "\f427"; +} + +.bi-image-alt::before { + content: "\f428"; +} + +.bi-image-fill::before { + content: "\f429"; +} + +.bi-image::before { + content: "\f42a"; +} + +.bi-images::before { + content: "\f42b"; +} + +.bi-inbox-fill::before { + content: "\f42c"; +} + +.bi-inbox::before { + content: "\f42d"; +} + +.bi-inboxes-fill::before { + content: "\f42e"; +} + +.bi-inboxes::before { + content: "\f42f"; +} + +.bi-info-circle-fill::before { + content: "\f430"; +} + +.bi-info-circle::before { + content: "\f431"; +} + +.bi-info-square-fill::before { + content: "\f432"; +} + +.bi-info-square::before { + content: "\f433"; +} + +.bi-info::before { + content: "\f434"; +} + +.bi-input-cursor-text::before { + content: "\f435"; +} + +.bi-input-cursor::before { + content: "\f436"; +} + +.bi-instagram::before { + content: "\f437"; +} + +.bi-intersect::before { + content: "\f438"; +} + +.bi-journal-album::before { + content: "\f439"; +} + +.bi-journal-arrow-down::before { + content: "\f43a"; +} + +.bi-journal-arrow-up::before { + content: "\f43b"; +} + +.bi-journal-bookmark-fill::before { + content: "\f43c"; +} + +.bi-journal-bookmark::before { + content: "\f43d"; +} + +.bi-journal-check::before { + content: "\f43e"; +} + +.bi-journal-code::before { + content: "\f43f"; +} + +.bi-journal-medical::before { + content: "\f440"; +} + +.bi-journal-minus::before { + content: "\f441"; +} + +.bi-journal-plus::before { + content: "\f442"; +} + +.bi-journal-richtext::before { + content: "\f443"; +} + +.bi-journal-text::before { + content: "\f444"; +} + +.bi-journal-x::before { + content: "\f445"; +} + +.bi-journal::before { + content: "\f446"; +} + +.bi-journals::before { + content: "\f447"; +} + +.bi-joystick::before { + content: "\f448"; +} + +.bi-justify-left::before { + content: "\f449"; +} + +.bi-justify-right::before { + content: "\f44a"; +} + +.bi-justify::before { + content: "\f44b"; +} + +.bi-kanban-fill::before { + content: "\f44c"; +} + +.bi-kanban::before { + content: "\f44d"; +} + +.bi-key-fill::before { + content: "\f44e"; +} + +.bi-key::before { + content: "\f44f"; +} + +.bi-keyboard-fill::before { + content: "\f450"; +} + +.bi-keyboard::before { + content: "\f451"; +} + +.bi-ladder::before { + content: "\f452"; +} + +.bi-lamp-fill::before { + content: "\f453"; +} + +.bi-lamp::before { + content: "\f454"; +} + +.bi-laptop-fill::before { + content: "\f455"; +} + +.bi-laptop::before { + content: "\f456"; +} + +.bi-layer-backward::before { + content: "\f457"; +} + +.bi-layer-forward::before { + content: "\f458"; +} + +.bi-layers-fill::before { + content: "\f459"; +} + +.bi-layers-half::before { + content: "\f45a"; +} + +.bi-layers::before { + content: "\f45b"; +} + +.bi-layout-sidebar-inset-reverse::before { + content: "\f45c"; +} + +.bi-layout-sidebar-inset::before { + content: "\f45d"; +} + +.bi-layout-sidebar-reverse::before { + content: "\f45e"; +} + +.bi-layout-sidebar::before { + content: "\f45f"; +} + +.bi-layout-split::before { + content: "\f460"; +} + +.bi-layout-text-sidebar-reverse::before { + content: "\f461"; +} + +.bi-layout-text-sidebar::before { + content: "\f462"; +} + +.bi-layout-text-window-reverse::before { + content: "\f463"; +} + +.bi-layout-text-window::before { + content: "\f464"; +} + +.bi-layout-three-columns::before { + content: "\f465"; +} + +.bi-layout-wtf::before { + content: "\f466"; +} + +.bi-life-preserver::before { + content: "\f467"; +} + +.bi-lightbulb-fill::before { + content: "\f468"; +} + +.bi-lightbulb-off-fill::before { + content: "\f469"; +} + +.bi-lightbulb-off::before { + content: "\f46a"; +} + +.bi-lightbulb::before { + content: "\f46b"; +} + +.bi-lightning-charge-fill::before { + content: "\f46c"; +} + +.bi-lightning-charge::before { + content: "\f46d"; +} + +.bi-lightning-fill::before { + content: "\f46e"; +} + +.bi-lightning::before { + content: "\f46f"; +} + +.bi-link-45deg::before { + content: "\f470"; +} + +.bi-link::before { + content: "\f471"; +} + +.bi-linkedin::before { + content: "\f472"; +} + +.bi-list-check::before { + content: "\f473"; +} + +.bi-list-nested::before { + content: "\f474"; +} + +.bi-list-ol::before { + content: "\f475"; +} + +.bi-list-stars::before { + content: "\f476"; +} + +.bi-list-task::before { + content: "\f477"; +} + +.bi-list-ul::before { + content: "\f478"; +} + +.bi-list::before { + content: "\f479"; +} + +.bi-lock-fill::before { + content: "\f47a"; +} + +.bi-lock::before { + content: "\f47b"; +} + +.bi-mailbox::before { + content: "\f47c"; +} + +.bi-mailbox2::before { + content: "\f47d"; +} + +.bi-map-fill::before { + content: "\f47e"; +} + +.bi-map::before { + content: "\f47f"; +} + +.bi-markdown-fill::before { + content: "\f480"; +} + +.bi-markdown::before { + content: "\f481"; +} + +.bi-mask::before { + content: "\f482"; +} + +.bi-megaphone-fill::before { + content: "\f483"; +} + +.bi-megaphone::before { + content: "\f484"; +} + +.bi-menu-app-fill::before { + content: "\f485"; +} + +.bi-menu-app::before { + content: "\f486"; +} + +.bi-menu-button-fill::before { + content: "\f487"; +} + +.bi-menu-button-wide-fill::before { + content: "\f488"; +} + +.bi-menu-button-wide::before { + content: "\f489"; +} + +.bi-menu-button::before { + content: "\f48a"; +} + +.bi-menu-down::before { + content: "\f48b"; +} + +.bi-menu-up::before { + content: "\f48c"; +} + +.bi-mic-fill::before { + content: "\f48d"; +} + +.bi-mic-mute-fill::before { + content: "\f48e"; +} + +.bi-mic-mute::before { + content: "\f48f"; +} + +.bi-mic::before { + content: "\f490"; +} + +.bi-minecart-loaded::before { + content: "\f491"; +} + +.bi-minecart::before { + content: "\f492"; +} + +.bi-moisture::before { + content: "\f493"; +} + +.bi-moon-fill::before { + content: "\f494"; +} + +.bi-moon-stars-fill::before { + content: "\f495"; +} + +.bi-moon-stars::before { + content: "\f496"; +} + +.bi-moon::before { + content: "\f497"; +} + +.bi-mouse-fill::before { + content: "\f498"; +} + +.bi-mouse::before { + content: "\f499"; +} + +.bi-mouse2-fill::before { + content: "\f49a"; +} + +.bi-mouse2::before { + content: "\f49b"; +} + +.bi-mouse3-fill::before { + content: "\f49c"; +} + +.bi-mouse3::before { + content: "\f49d"; +} + +.bi-music-note-beamed::before { + content: "\f49e"; +} + +.bi-music-note-list::before { + content: "\f49f"; +} + +.bi-music-note::before { + content: "\f4a0"; +} + +.bi-music-player-fill::before { + content: "\f4a1"; +} + +.bi-music-player::before { + content: "\f4a2"; +} + +.bi-newspaper::before { + content: "\f4a3"; +} + +.bi-node-minus-fill::before { + content: "\f4a4"; +} + +.bi-node-minus::before { + content: "\f4a5"; +} + +.bi-node-plus-fill::before { + content: "\f4a6"; +} + +.bi-node-plus::before { + content: "\f4a7"; +} + +.bi-nut-fill::before { + content: "\f4a8"; +} + +.bi-nut::before { + content: "\f4a9"; +} + +.bi-octagon-fill::before { + content: "\f4aa"; +} + +.bi-octagon-half::before { + content: "\f4ab"; +} + +.bi-octagon::before { + content: "\f4ac"; +} + +.bi-option::before { + content: "\f4ad"; +} + +.bi-outlet::before { + content: "\f4ae"; +} + +.bi-paint-bucket::before { + content: "\f4af"; +} + +.bi-palette-fill::before { + content: "\f4b0"; +} + +.bi-palette::before { + content: "\f4b1"; +} + +.bi-palette2::before { + content: "\f4b2"; +} + +.bi-paperclip::before { + content: "\f4b3"; +} + +.bi-paragraph::before { + content: "\f4b4"; +} + +.bi-patch-check-fill::before { + content: "\f4b5"; +} + +.bi-patch-check::before { + content: "\f4b6"; +} + +.bi-patch-exclamation-fill::before { + content: "\f4b7"; +} + +.bi-patch-exclamation::before { + content: "\f4b8"; +} + +.bi-patch-minus-fill::before { + content: "\f4b9"; +} + +.bi-patch-minus::before { + content: "\f4ba"; +} + +.bi-patch-plus-fill::before { + content: "\f4bb"; +} + +.bi-patch-plus::before { + content: "\f4bc"; +} + +.bi-patch-question-fill::before { + content: "\f4bd"; +} + +.bi-patch-question::before { + content: "\f4be"; +} + +.bi-pause-btn-fill::before { + content: "\f4bf"; +} + +.bi-pause-btn::before { + content: "\f4c0"; +} + +.bi-pause-circle-fill::before { + content: "\f4c1"; +} + +.bi-pause-circle::before { + content: "\f4c2"; +} + +.bi-pause-fill::before { + content: "\f4c3"; +} + +.bi-pause::before { + content: "\f4c4"; +} + +.bi-peace-fill::before { + content: "\f4c5"; +} + +.bi-peace::before { + content: "\f4c6"; +} + +.bi-pen-fill::before { + content: "\f4c7"; +} + +.bi-pen::before { + content: "\f4c8"; +} + +.bi-pencil-fill::before { + content: "\f4c9"; +} + +.bi-pencil-square::before { + content: "\f4ca"; +} + +.bi-pencil::before { + content: "\f4cb"; +} + +.bi-pentagon-fill::before { + content: "\f4cc"; +} + +.bi-pentagon-half::before { + content: "\f4cd"; +} + +.bi-pentagon::before { + content: "\f4ce"; +} + +.bi-people-fill::before { + content: "\f4cf"; +} + +.bi-people::before { + content: "\f4d0"; +} + +.bi-percent::before { + content: "\f4d1"; +} + +.bi-person-badge-fill::before { + content: "\f4d2"; +} + +.bi-person-badge::before { + content: "\f4d3"; +} + +.bi-person-bounding-box::before { + content: "\f4d4"; +} + +.bi-person-check-fill::before { + content: "\f4d5"; +} + +.bi-person-check::before { + content: "\f4d6"; +} + +.bi-person-circle::before { + content: "\f4d7"; +} + +.bi-person-dash-fill::before { + content: "\f4d8"; +} + +.bi-person-dash::before { + content: "\f4d9"; +} + +.bi-person-fill::before { + content: "\f4da"; +} + +.bi-person-lines-fill::before { + content: "\f4db"; +} + +.bi-person-plus-fill::before { + content: "\f4dc"; +} + +.bi-person-plus::before { + content: "\f4dd"; +} + +.bi-person-square::before { + content: "\f4de"; +} + +.bi-person-x-fill::before { + content: "\f4df"; +} + +.bi-person-x::before { + content: "\f4e0"; +} + +.bi-person::before { + content: "\f4e1"; +} + +.bi-phone-fill::before { + content: "\f4e2"; +} + +.bi-phone-landscape-fill::before { + content: "\f4e3"; +} + +.bi-phone-landscape::before { + content: "\f4e4"; +} + +.bi-phone-vibrate-fill::before { + content: "\f4e5"; +} + +.bi-phone-vibrate::before { + content: "\f4e6"; +} + +.bi-phone::before { + content: "\f4e7"; +} + +.bi-pie-chart-fill::before { + content: "\f4e8"; +} + +.bi-pie-chart::before { + content: "\f4e9"; +} + +.bi-pin-angle-fill::before { + content: "\f4ea"; +} + +.bi-pin-angle::before { + content: "\f4eb"; +} + +.bi-pin-fill::before { + content: "\f4ec"; +} + +.bi-pin::before { + content: "\f4ed"; +} + +.bi-pip-fill::before { + content: "\f4ee"; +} + +.bi-pip::before { + content: "\f4ef"; +} + +.bi-play-btn-fill::before { + content: "\f4f0"; +} + +.bi-play-btn::before { + content: "\f4f1"; +} + +.bi-play-circle-fill::before { + content: "\f4f2"; +} + +.bi-play-circle::before { + content: "\f4f3"; +} + +.bi-play-fill::before { + content: "\f4f4"; +} + +.bi-play::before { + content: "\f4f5"; +} + +.bi-plug-fill::before { + content: "\f4f6"; +} + +.bi-plug::before { + content: "\f4f7"; +} + +.bi-plus-circle-dotted::before { + content: "\f4f8"; +} + +.bi-plus-circle-fill::before { + content: "\f4f9"; +} + +.bi-plus-circle::before { + content: "\f4fa"; +} + +.bi-plus-square-dotted::before { + content: "\f4fb"; +} + +.bi-plus-square-fill::before { + content: "\f4fc"; +} + +.bi-plus-square::before { + content: "\f4fd"; +} + +.bi-plus::before { + content: "\f4fe"; +} + +.bi-power::before { + content: "\f4ff"; +} + +.bi-printer-fill::before { + content: "\f500"; +} + +.bi-printer::before { + content: "\f501"; +} + +.bi-puzzle-fill::before { + content: "\f502"; +} + +.bi-puzzle::before { + content: "\f503"; +} + +.bi-question-circle-fill::before { + content: "\f504"; +} + +.bi-question-circle::before { + content: "\f505"; +} + +.bi-question-diamond-fill::before { + content: "\f506"; +} + +.bi-question-diamond::before { + content: "\f507"; +} + +.bi-question-octagon-fill::before { + content: "\f508"; +} + +.bi-question-octagon::before { + content: "\f509"; +} + +.bi-question-square-fill::before { + content: "\f50a"; +} + +.bi-question-square::before { + content: "\f50b"; +} + +.bi-question::before { + content: "\f50c"; +} + +.bi-rainbow::before { + content: "\f50d"; +} + +.bi-receipt-cutoff::before { + content: "\f50e"; +} + +.bi-receipt::before { + content: "\f50f"; +} + +.bi-reception-0::before { + content: "\f510"; +} + +.bi-reception-1::before { + content: "\f511"; +} + +.bi-reception-2::before { + content: "\f512"; +} + +.bi-reception-3::before { + content: "\f513"; +} + +.bi-reception-4::before { + content: "\f514"; +} + +.bi-record-btn-fill::before { + content: "\f515"; +} + +.bi-record-btn::before { + content: "\f516"; +} + +.bi-record-circle-fill::before { + content: "\f517"; +} + +.bi-record-circle::before { + content: "\f518"; +} + +.bi-record-fill::before { + content: "\f519"; +} + +.bi-record::before { + content: "\f51a"; +} + +.bi-record2-fill::before { + content: "\f51b"; +} + +.bi-record2::before { + content: "\f51c"; +} + +.bi-reply-all-fill::before { + content: "\f51d"; +} + +.bi-reply-all::before { + content: "\f51e"; +} + +.bi-reply-fill::before { + content: "\f51f"; +} + +.bi-reply::before { + content: "\f520"; +} + +.bi-rss-fill::before { + content: "\f521"; +} + +.bi-rss::before { + content: "\f522"; +} + +.bi-rulers::before { + content: "\f523"; +} + +.bi-save-fill::before { + content: "\f524"; +} + +.bi-save::before { + content: "\f525"; +} + +.bi-save2-fill::before { + content: "\f526"; +} + +.bi-save2::before { + content: "\f527"; +} + +.bi-scissors::before { + content: "\f528"; +} + +.bi-screwdriver::before { + content: "\f529"; +} + +.bi-search::before { + content: "\f52a"; +} + +.bi-segmented-nav::before { + content: "\f52b"; +} + +.bi-server::before { + content: "\f52c"; +} + +.bi-share-fill::before { + content: "\f52d"; +} + +.bi-share::before { + content: "\f52e"; +} + +.bi-shield-check::before { + content: "\f52f"; +} + +.bi-shield-exclamation::before { + content: "\f530"; +} + +.bi-shield-fill-check::before { + content: "\f531"; +} + +.bi-shield-fill-exclamation::before { + content: "\f532"; +} + +.bi-shield-fill-minus::before { + content: "\f533"; +} + +.bi-shield-fill-plus::before { + content: "\f534"; +} + +.bi-shield-fill-x::before { + content: "\f535"; +} + +.bi-shield-fill::before { + content: "\f536"; +} + +.bi-shield-lock-fill::before { + content: "\f537"; +} + +.bi-shield-lock::before { + content: "\f538"; +} + +.bi-shield-minus::before { + content: "\f539"; +} + +.bi-shield-plus::before { + content: "\f53a"; +} + +.bi-shield-shaded::before { + content: "\f53b"; +} + +.bi-shield-slash-fill::before { + content: "\f53c"; +} + +.bi-shield-slash::before { + content: "\f53d"; +} + +.bi-shield-x::before { + content: "\f53e"; +} + +.bi-shield::before { + content: "\f53f"; +} + +.bi-shift-fill::before { + content: "\f540"; +} + +.bi-shift::before { + content: "\f541"; +} + +.bi-shop-window::before { + content: "\f542"; +} + +.bi-shop::before { + content: "\f543"; +} + +.bi-shuffle::before { + content: "\f544"; +} + +.bi-signpost-2-fill::before { + content: "\f545"; +} + +.bi-signpost-2::before { + content: "\f546"; +} + +.bi-signpost-fill::before { + content: "\f547"; +} + +.bi-signpost-split-fill::before { + content: "\f548"; +} + +.bi-signpost-split::before { + content: "\f549"; +} + +.bi-signpost::before { + content: "\f54a"; +} + +.bi-sim-fill::before { + content: "\f54b"; +} + +.bi-sim::before { + content: "\f54c"; +} + +.bi-skip-backward-btn-fill::before { + content: "\f54d"; +} + +.bi-skip-backward-btn::before { + content: "\f54e"; +} + +.bi-skip-backward-circle-fill::before { + content: "\f54f"; +} + +.bi-skip-backward-circle::before { + content: "\f550"; +} + +.bi-skip-backward-fill::before { + content: "\f551"; +} + +.bi-skip-backward::before { + content: "\f552"; +} + +.bi-skip-end-btn-fill::before { + content: "\f553"; +} + +.bi-skip-end-btn::before { + content: "\f554"; +} + +.bi-skip-end-circle-fill::before { + content: "\f555"; +} + +.bi-skip-end-circle::before { + content: "\f556"; +} + +.bi-skip-end-fill::before { + content: "\f557"; +} + +.bi-skip-end::before { + content: "\f558"; +} + +.bi-skip-forward-btn-fill::before { + content: "\f559"; +} + +.bi-skip-forward-btn::before { + content: "\f55a"; +} + +.bi-skip-forward-circle-fill::before { + content: "\f55b"; +} + +.bi-skip-forward-circle::before { + content: "\f55c"; +} + +.bi-skip-forward-fill::before { + content: "\f55d"; +} + +.bi-skip-forward::before { + content: "\f55e"; +} + +.bi-skip-start-btn-fill::before { + content: "\f55f"; +} + +.bi-skip-start-btn::before { + content: "\f560"; +} + +.bi-skip-start-circle-fill::before { + content: "\f561"; +} + +.bi-skip-start-circle::before { + content: "\f562"; +} + +.bi-skip-start-fill::before { + content: "\f563"; +} + +.bi-skip-start::before { + content: "\f564"; +} + +.bi-slack::before { + content: "\f565"; +} + +.bi-slash-circle-fill::before { + content: "\f566"; +} + +.bi-slash-circle::before { + content: "\f567"; +} + +.bi-slash-square-fill::before { + content: "\f568"; +} + +.bi-slash-square::before { + content: "\f569"; +} + +.bi-slash::before { + content: "\f56a"; +} + +.bi-sliders::before { + content: "\f56b"; +} + +.bi-smartwatch::before { + content: "\f56c"; +} + +.bi-snow::before { + content: "\f56d"; +} + +.bi-snow2::before { + content: "\f56e"; +} + +.bi-snow3::before { + content: "\f56f"; +} + +.bi-sort-alpha-down-alt::before { + content: "\f570"; +} + +.bi-sort-alpha-down::before { + content: "\f571"; +} + +.bi-sort-alpha-up-alt::before { + content: "\f572"; +} + +.bi-sort-alpha-up::before { + content: "\f573"; +} + +.bi-sort-down-alt::before { + content: "\f574"; +} + +.bi-sort-down::before { + content: "\f575"; +} + +.bi-sort-numeric-down-alt::before { + content: "\f576"; +} + +.bi-sort-numeric-down::before { + content: "\f577"; +} + +.bi-sort-numeric-up-alt::before { + content: "\f578"; +} + +.bi-sort-numeric-up::before { + content: "\f579"; +} + +.bi-sort-up-alt::before { + content: "\f57a"; +} + +.bi-sort-up::before { + content: "\f57b"; +} + +.bi-soundwave::before { + content: "\f57c"; +} + +.bi-speaker-fill::before { + content: "\f57d"; +} + +.bi-speaker::before { + content: "\f57e"; +} + +.bi-speedometer::before { + content: "\f57f"; +} + +.bi-speedometer2::before { + content: "\f580"; +} + +.bi-spellcheck::before { + content: "\f581"; +} + +.bi-square-fill::before { + content: "\f582"; +} + +.bi-square-half::before { + content: "\f583"; +} + +.bi-square::before { + content: "\f584"; +} + +.bi-stack::before { + content: "\f585"; +} + +.bi-star-fill::before { + content: "\f586"; +} + +.bi-star-half::before { + content: "\f587"; +} + +.bi-star::before { + content: "\f588"; +} + +.bi-stars::before { + content: "\f589"; +} + +.bi-stickies-fill::before { + content: "\f58a"; +} + +.bi-stickies::before { + content: "\f58b"; +} + +.bi-sticky-fill::before { + content: "\f58c"; +} + +.bi-sticky::before { + content: "\f58d"; +} + +.bi-stop-btn-fill::before { + content: "\f58e"; +} + +.bi-stop-btn::before { + content: "\f58f"; +} + +.bi-stop-circle-fill::before { + content: "\f590"; +} + +.bi-stop-circle::before { + content: "\f591"; +} + +.bi-stop-fill::before { + content: "\f592"; +} + +.bi-stop::before { + content: "\f593"; +} + +.bi-stoplights-fill::before { + content: "\f594"; +} + +.bi-stoplights::before { + content: "\f595"; +} + +.bi-stopwatch-fill::before { + content: "\f596"; +} + +.bi-stopwatch::before { + content: "\f597"; +} + +.bi-subtract::before { + content: "\f598"; +} + +.bi-suit-club-fill::before { + content: "\f599"; +} + +.bi-suit-club::before { + content: "\f59a"; +} + +.bi-suit-diamond-fill::before { + content: "\f59b"; +} + +.bi-suit-diamond::before { + content: "\f59c"; +} + +.bi-suit-heart-fill::before { + content: "\f59d"; +} + +.bi-suit-heart::before { + content: "\f59e"; +} + +.bi-suit-spade-fill::before { + content: "\f59f"; +} + +.bi-suit-spade::before { + content: "\f5a0"; +} + +.bi-sun-fill::before { + content: "\f5a1"; +} + +.bi-sun::before { + content: "\f5a2"; +} + +.bi-sunglasses::before { + content: "\f5a3"; +} + +.bi-sunrise-fill::before { + content: "\f5a4"; +} + +.bi-sunrise::before { + content: "\f5a5"; +} + +.bi-sunset-fill::before { + content: "\f5a6"; +} + +.bi-sunset::before { + content: "\f5a7"; +} + +.bi-symmetry-horizontal::before { + content: "\f5a8"; +} + +.bi-symmetry-vertical::before { + content: "\f5a9"; +} + +.bi-table::before { + content: "\f5aa"; +} + +.bi-tablet-fill::before { + content: "\f5ab"; +} + +.bi-tablet-landscape-fill::before { + content: "\f5ac"; +} + +.bi-tablet-landscape::before { + content: "\f5ad"; +} + +.bi-tablet::before { + content: "\f5ae"; +} + +.bi-tag-fill::before { + content: "\f5af"; +} + +.bi-tag::before { + content: "\f5b0"; +} + +.bi-tags-fill::before { + content: "\f5b1"; +} + +.bi-tags::before { + content: "\f5b2"; +} + +.bi-telegram::before { + content: "\f5b3"; +} + +.bi-telephone-fill::before { + content: "\f5b4"; +} + +.bi-telephone-forward-fill::before { + content: "\f5b5"; +} + +.bi-telephone-forward::before { + content: "\f5b6"; +} + +.bi-telephone-inbound-fill::before { + content: "\f5b7"; +} + +.bi-telephone-inbound::before { + content: "\f5b8"; +} + +.bi-telephone-minus-fill::before { + content: "\f5b9"; +} + +.bi-telephone-minus::before { + content: "\f5ba"; +} + +.bi-telephone-outbound-fill::before { + content: "\f5bb"; +} + +.bi-telephone-outbound::before { + content: "\f5bc"; +} + +.bi-telephone-plus-fill::before { + content: "\f5bd"; +} + +.bi-telephone-plus::before { + content: "\f5be"; +} + +.bi-telephone-x-fill::before { + content: "\f5bf"; +} + +.bi-telephone-x::before { + content: "\f5c0"; +} + +.bi-telephone::before { + content: "\f5c1"; +} + +.bi-terminal-fill::before { + content: "\f5c2"; +} + +.bi-terminal::before { + content: "\f5c3"; +} + +.bi-text-center::before { + content: "\f5c4"; +} + +.bi-text-indent-left::before { + content: "\f5c5"; +} + +.bi-text-indent-right::before { + content: "\f5c6"; +} + +.bi-text-left::before { + content: "\f5c7"; +} + +.bi-text-paragraph::before { + content: "\f5c8"; +} + +.bi-text-right::before { + content: "\f5c9"; +} + +.bi-textarea-resize::before { + content: "\f5ca"; +} + +.bi-textarea-t::before { + content: "\f5cb"; +} + +.bi-textarea::before { + content: "\f5cc"; +} + +.bi-thermometer-half::before { + content: "\f5cd"; +} + +.bi-thermometer-high::before { + content: "\f5ce"; +} + +.bi-thermometer-low::before { + content: "\f5cf"; +} + +.bi-thermometer-snow::before { + content: "\f5d0"; +} + +.bi-thermometer-sun::before { + content: "\f5d1"; +} + +.bi-thermometer::before { + content: "\f5d2"; +} + +.bi-three-dots-vertical::before { + content: "\f5d3"; +} + +.bi-three-dots::before { + content: "\f5d4"; +} + +.bi-toggle-off::before { + content: "\f5d5"; +} + +.bi-toggle-on::before { + content: "\f5d6"; +} + +.bi-toggle2-off::before { + content: "\f5d7"; +} + +.bi-toggle2-on::before { + content: "\f5d8"; +} + +.bi-toggles::before { + content: "\f5d9"; +} + +.bi-toggles2::before { + content: "\f5da"; +} + +.bi-tools::before { + content: "\f5db"; +} + +.bi-tornado::before { + content: "\f5dc"; +} + +.bi-trash-fill::before { + content: "\f5dd"; +} + +.bi-trash::before { + content: "\f5de"; +} + +.bi-trash2-fill::before { + content: "\f5df"; +} + +.bi-trash2::before { + content: "\f5e0"; +} + +.bi-tree-fill::before { + content: "\f5e1"; +} + +.bi-tree::before { + content: "\f5e2"; +} + +.bi-triangle-fill::before { + content: "\f5e3"; +} + +.bi-triangle-half::before { + content: "\f5e4"; +} + +.bi-triangle::before { + content: "\f5e5"; +} + +.bi-trophy-fill::before { + content: "\f5e6"; +} + +.bi-trophy::before { + content: "\f5e7"; +} + +.bi-tropical-storm::before { + content: "\f5e8"; +} + +.bi-truck-flatbed::before { + content: "\f5e9"; +} + +.bi-truck::before { + content: "\f5ea"; +} + +.bi-tsunami::before { + content: "\f5eb"; +} + +.bi-tv-fill::before { + content: "\f5ec"; +} + +.bi-tv::before { + content: "\f5ed"; +} + +.bi-twitch::before { + content: "\f5ee"; +} + +.bi-twitter::before { + content: "\f5ef"; +} + +.bi-type-bold::before { + content: "\f5f0"; +} + +.bi-type-h1::before { + content: "\f5f1"; +} + +.bi-type-h2::before { + content: "\f5f2"; +} + +.bi-type-h3::before { + content: "\f5f3"; +} + +.bi-type-italic::before { + content: "\f5f4"; +} + +.bi-type-strikethrough::before { + content: "\f5f5"; +} + +.bi-type-underline::before { + content: "\f5f6"; +} + +.bi-type::before { + content: "\f5f7"; +} + +.bi-ui-checks-grid::before { + content: "\f5f8"; +} + +.bi-ui-checks::before { + content: "\f5f9"; +} + +.bi-ui-radios-grid::before { + content: "\f5fa"; +} + +.bi-ui-radios::before { + content: "\f5fb"; +} + +.bi-umbrella-fill::before { + content: "\f5fc"; +} + +.bi-umbrella::before { + content: "\f5fd"; +} + +.bi-union::before { + content: "\f5fe"; +} + +.bi-unlock-fill::before { + content: "\f5ff"; +} + +.bi-unlock::before { + content: "\f600"; +} + +.bi-upc-scan::before { + content: "\f601"; +} + +.bi-upc::before { + content: "\f602"; +} + +.bi-upload::before { + content: "\f603"; +} + +.bi-vector-pen::before { + content: "\f604"; +} + +.bi-view-list::before { + content: "\f605"; +} + +.bi-view-stacked::before { + content: "\f606"; +} + +.bi-vinyl-fill::before { + content: "\f607"; +} + +.bi-vinyl::before { + content: "\f608"; +} + +.bi-voicemail::before { + content: "\f609"; +} + +.bi-volume-down-fill::before { + content: "\f60a"; +} + +.bi-volume-down::before { + content: "\f60b"; +} + +.bi-volume-mute-fill::before { + content: "\f60c"; +} + +.bi-volume-mute::before { + content: "\f60d"; +} + +.bi-volume-off-fill::before { + content: "\f60e"; +} + +.bi-volume-off::before { + content: "\f60f"; +} + +.bi-volume-up-fill::before { + content: "\f610"; +} + +.bi-volume-up::before { + content: "\f611"; +} + +.bi-vr::before { + content: "\f612"; +} + +.bi-wallet-fill::before { + content: "\f613"; +} + +.bi-wallet::before { + content: "\f614"; +} + +.bi-wallet2::before { + content: "\f615"; +} + +.bi-watch::before { + content: "\f616"; +} + +.bi-water::before { + content: "\f617"; +} + +.bi-whatsapp::before { + content: "\f618"; +} + +.bi-wifi-1::before { + content: "\f619"; +} + +.bi-wifi-2::before { + content: "\f61a"; +} + +.bi-wifi-off::before { + content: "\f61b"; +} + +.bi-wifi::before { + content: "\f61c"; +} + +.bi-wind::before { + content: "\f61d"; +} + +.bi-window-dock::before { + content: "\f61e"; +} + +.bi-window-sidebar::before { + content: "\f61f"; +} + +.bi-window::before { + content: "\f620"; +} + +.bi-wrench::before { + content: "\f621"; +} + +.bi-x-circle-fill::before { + content: "\f622"; +} + +.bi-x-circle::before { + content: "\f623"; +} + +.bi-x-diamond-fill::before { + content: "\f624"; +} + +.bi-x-diamond::before { + content: "\f625"; +} + +.bi-x-octagon-fill::before { + content: "\f626"; +} + +.bi-x-octagon::before { + content: "\f627"; +} + +.bi-x-square-fill::before { + content: "\f628"; +} + +.bi-x-square::before { + content: "\f629"; +} + +.bi-x::before { + content: "\f62a"; +} + +.bi-youtube::before { + content: "\f62b"; +} + +.bi-zoom-in::before { + content: "\f62c"; +} + +.bi-zoom-out::before { + content: "\f62d"; +} + +.bi-bank::before { + content: "\f62e"; +} + +.bi-bank2::before { + content: "\f62f"; +} + +.bi-bell-slash-fill::before { + content: "\f630"; +} + +.bi-bell-slash::before { + content: "\f631"; +} + +.bi-cash-coin::before { + content: "\f632"; +} + +.bi-check-lg::before { + content: "\f633"; +} + +.bi-coin::before { + content: "\f634"; +} + +.bi-currency-bitcoin::before { + content: "\f635"; +} + +.bi-currency-dollar::before { + content: "\f636"; +} + +.bi-currency-euro::before { + content: "\f637"; +} + +.bi-currency-exchange::before { + content: "\f638"; +} + +.bi-currency-pound::before { + content: "\f639"; +} + +.bi-currency-yen::before { + content: "\f63a"; +} + +.bi-dash-lg::before { + content: "\f63b"; +} + +.bi-exclamation-lg::before { + content: "\f63c"; +} + +.bi-file-earmark-pdf-fill::before { + content: "\f63d"; +} + +.bi-file-earmark-pdf::before { + content: "\f63e"; +} + +.bi-file-pdf-fill::before { + content: "\f63f"; +} + +.bi-file-pdf::before { + content: "\f640"; +} + +.bi-gender-ambiguous::before { + content: "\f641"; +} + +.bi-gender-female::before { + content: "\f642"; +} + +.bi-gender-male::before { + content: "\f643"; +} + +.bi-gender-trans::before { + content: "\f644"; +} + +.bi-headset-vr::before { + content: "\f645"; +} + +.bi-info-lg::before { + content: "\f646"; +} + +.bi-mastodon::before { + content: "\f647"; +} + +.bi-messenger::before { + content: "\f648"; +} + +.bi-piggy-bank-fill::before { + content: "\f649"; +} + +.bi-piggy-bank::before { + content: "\f64a"; +} + +.bi-pin-map-fill::before { + content: "\f64b"; +} + +.bi-pin-map::before { + content: "\f64c"; +} + +.bi-plus-lg::before { + content: "\f64d"; +} + +.bi-question-lg::before { + content: "\f64e"; +} + +.bi-recycle::before { + content: "\f64f"; +} + +.bi-reddit::before { + content: "\f650"; +} + +.bi-safe-fill::before { + content: "\f651"; +} + +.bi-safe2-fill::before { + content: "\f652"; +} + +.bi-safe2::before { + content: "\f653"; +} + +.bi-sd-card-fill::before { + content: "\f654"; +} + +.bi-sd-card::before { + content: "\f655"; +} + +.bi-skype::before { + content: "\f656"; +} + +.bi-slash-lg::before { + content: "\f657"; +} + +.bi-translate::before { + content: "\f658"; +} + +.bi-x-lg::before { + content: "\f659"; +} + +.bi-safe::before { + content: "\f65a"; +} + +.bi-apple::before { + content: "\f65b"; +} + +.bi-microsoft::before { + content: "\f65d"; +} + +.bi-windows::before { + content: "\f65e"; +} + +.bi-behance::before { + content: "\f65c"; +} + +.bi-dribbble::before { + content: "\f65f"; +} + +.bi-line::before { + content: "\f660"; +} + +.bi-medium::before { + content: "\f661"; +} + +.bi-paypal::before { + content: "\f662"; +} + +.bi-pinterest::before { + content: "\f663"; +} + +.bi-signal::before { + content: "\f664"; +} + +.bi-snapchat::before { + content: "\f665"; +} + +.bi-spotify::before { + content: "\f666"; +} + +.bi-stack-overflow::before { + content: "\f667"; +} + +.bi-strava::before { + content: "\f668"; +} + +.bi-wordpress::before { + content: "\f669"; +} + +.bi-vimeo::before { + content: "\f66a"; +} + +.bi-activity::before { + content: "\f66b"; +} + +.bi-easel2-fill::before { + content: "\f66c"; +} + +.bi-easel2::before { + content: "\f66d"; +} + +.bi-easel3-fill::before { + content: "\f66e"; +} + +.bi-easel3::before { + content: "\f66f"; +} + +.bi-fan::before { + content: "\f670"; +} + +.bi-fingerprint::before { + content: "\f671"; +} + +.bi-graph-down-arrow::before { + content: "\f672"; +} + +.bi-graph-up-arrow::before { + content: "\f673"; +} + +.bi-hypnotize::before { + content: "\f674"; +} + +.bi-magic::before { + content: "\f675"; +} + +.bi-person-rolodex::before { + content: "\f676"; +} + +.bi-person-video::before { + content: "\f677"; +} + +.bi-person-video2::before { + content: "\f678"; +} + +.bi-person-video3::before { + content: "\f679"; +} + +.bi-person-workspace::before { + content: "\f67a"; +} + +.bi-radioactive::before { + content: "\f67b"; +} + +.bi-webcam-fill::before { + content: "\f67c"; +} + +.bi-webcam::before { + content: "\f67d"; +} + +.bi-yin-yang::before { + content: "\f67e"; +} + +.bi-bandaid-fill::before { + content: "\f680"; +} + +.bi-bandaid::before { + content: "\f681"; +} + +.bi-bluetooth::before { + content: "\f682"; +} + +.bi-body-text::before { + content: "\f683"; +} + +.bi-boombox::before { + content: "\f684"; +} + +.bi-boxes::before { + content: "\f685"; +} + +.bi-dpad-fill::before { + content: "\f686"; +} + +.bi-dpad::before { + content: "\f687"; +} + +.bi-ear-fill::before { + content: "\f688"; +} + +.bi-ear::before { + content: "\f689"; +} + +.bi-envelope-check-1::before { + content: "\f68a"; +} + +.bi-envelope-check-fill::before { + content: "\f68b"; +} + +.bi-envelope-check::before { + content: "\f68c"; +} + +.bi-envelope-dash-1::before { + content: "\f68d"; +} + +.bi-envelope-dash-fill::before { + content: "\f68e"; +} + +.bi-envelope-dash::before { + content: "\f68f"; +} + +.bi-envelope-exclamation-1::before { + content: "\f690"; +} + +.bi-envelope-exclamation-fill::before { + content: "\f691"; +} + +.bi-envelope-exclamation::before { + content: "\f692"; +} + +.bi-envelope-plus-fill::before { + content: "\f693"; +} + +.bi-envelope-plus::before { + content: "\f694"; +} + +.bi-envelope-slash-1::before { + content: "\f695"; +} + +.bi-envelope-slash-fill::before { + content: "\f696"; +} + +.bi-envelope-slash::before { + content: "\f697"; +} + +.bi-envelope-x-1::before { + content: "\f698"; +} + +.bi-envelope-x-fill::before { + content: "\f699"; +} + +.bi-envelope-x::before { + content: "\f69a"; +} + +.bi-explicit-fill::before { + content: "\f69b"; +} + +.bi-explicit::before { + content: "\f69c"; +} + +.bi-git::before { + content: "\f69d"; +} + +.bi-infinity::before { + content: "\f69e"; +} + +.bi-list-columns-reverse::before { + content: "\f69f"; +} + +.bi-list-columns::before { + content: "\f6a0"; +} + +.bi-meta::before { + content: "\f6a1"; +} + +.bi-mortorboard-fill::before { + content: "\f6a2"; +} + +.bi-mortorboard::before { + content: "\f6a3"; +} + +.bi-nintendo-switch::before { + content: "\f6a4"; +} + +.bi-pc-display-horizontal::before { + content: "\f6a5"; +} + +.bi-pc-display::before { + content: "\f6a6"; +} + +.bi-pc-horizontal::before { + content: "\f6a7"; +} + +.bi-pc::before { + content: "\f6a8"; +} + +.bi-playstation::before { + content: "\f6a9"; +} + +.bi-plus-slash-minus::before { + content: "\f6aa"; +} + +.bi-projector-fill::before { + content: "\f6ab"; +} + +.bi-projector::before { + content: "\f6ac"; +} + +.bi-qr-code-scan::before { + content: "\f6ad"; +} + +.bi-qr-code::before { + content: "\f6ae"; +} + +.bi-quora::before { + content: "\f6af"; +} + +.bi-quote::before { + content: "\f6b0"; +} + +.bi-robot::before { + content: "\f6b1"; +} + +.bi-send-check-fill::before { + content: "\f6b2"; +} + +.bi-send-check::before { + content: "\f6b3"; +} + +.bi-send-dash-fill::before { + content: "\f6b4"; +} + +.bi-send-dash::before { + content: "\f6b5"; +} + +.bi-send-exclamation-1::before { + content: "\f6b6"; +} + +.bi-send-exclamation-fill::before { + content: "\f6b7"; +} + +.bi-send-exclamation::before { + content: "\f6b8"; +} + +.bi-send-fill::before { + content: "\f6b9"; +} + +.bi-send-plus-fill::before { + content: "\f6ba"; +} + +.bi-send-plus::before { + content: "\f6bb"; +} + +.bi-send-slash-fill::before { + content: "\f6bc"; +} + +.bi-send-slash::before { + content: "\f6bd"; +} + +.bi-send-x-fill::before { + content: "\f6be"; +} + +.bi-send-x::before { + content: "\f6bf"; +} + +.bi-send::before { + content: "\f6c0"; +} + +.bi-steam::before { + content: "\f6c1"; +} + +.bi-terminal-dash-1::before { + content: "\f6c2"; +} + +.bi-terminal-dash::before { + content: "\f6c3"; +} + +.bi-terminal-plus::before { + content: "\f6c4"; +} + +.bi-terminal-split::before { + content: "\f6c5"; +} + +.bi-ticket-detailed-fill::before { + content: "\f6c6"; +} + +.bi-ticket-detailed::before { + content: "\f6c7"; +} + +.bi-ticket-fill::before { + content: "\f6c8"; +} + +.bi-ticket-perforated-fill::before { + content: "\f6c9"; +} + +.bi-ticket-perforated::before { + content: "\f6ca"; +} + +.bi-ticket::before { + content: "\f6cb"; +} + +.bi-tiktok::before { + content: "\f6cc"; +} + +.bi-window-dash::before { + content: "\f6cd"; +} + +.bi-window-desktop::before { + content: "\f6ce"; +} + +.bi-window-fullscreen::before { + content: "\f6cf"; +} + +.bi-window-plus::before { + content: "\f6d0"; +} + +.bi-window-split::before { + content: "\f6d1"; +} + +.bi-window-stack::before { + content: "\f6d2"; +} + +.bi-window-x::before { + content: "\f6d3"; +} + +.bi-xbox::before { + content: "\f6d4"; +} + +.bi-ethernet::before { + content: "\f6d5"; +} + +.bi-hdmi-fill::before { + content: "\f6d6"; +} + +.bi-hdmi::before { + content: "\f6d7"; +} + +.bi-usb-c-fill::before { + content: "\f6d8"; +} + +.bi-usb-c::before { + content: "\f6d9"; +} + +.bi-usb-fill::before { + content: "\f6da"; +} + +.bi-usb-plug-fill::before { + content: "\f6db"; +} + +.bi-usb-plug::before { + content: "\f6dc"; +} + +.bi-usb-symbol::before { + content: "\f6dd"; +} + +.bi-usb::before { + content: "\f6de"; +} + +.bi-boombox-fill::before { + content: "\f6df"; +} + +.bi-displayport-1::before { + content: "\f6e0"; +} + +.bi-displayport::before { + content: "\f6e1"; +} + +.bi-gpu-card::before { + content: "\f6e2"; +} + +.bi-memory::before { + content: "\f6e3"; +} + +.bi-modem-fill::before { + content: "\f6e4"; +} + +.bi-modem::before { + content: "\f6e5"; +} + +.bi-motherboard-fill::before { + content: "\f6e6"; +} + +.bi-motherboard::before { + content: "\f6e7"; +} + +.bi-optical-audio-fill::before { + content: "\f6e8"; +} + +.bi-optical-audio::before { + content: "\f6e9"; +} + +.bi-pci-card::before { + content: "\f6ea"; +} + +.bi-router-fill::before { + content: "\f6eb"; +} + +.bi-router::before { + content: "\f6ec"; +} + +.bi-ssd-fill::before { + content: "\f6ed"; +} + +.bi-ssd::before { + content: "\f6ee"; +} + +.bi-thunderbolt-fill::before { + content: "\f6ef"; +} + +.bi-thunderbolt::before { + content: "\f6f0"; +} + +.bi-usb-drive-fill::before { + content: "\f6f1"; +} + +.bi-usb-drive::before { + content: "\f6f2"; +} + +.bi-usb-micro-fill::before { + content: "\f6f3"; +} + +.bi-usb-micro::before { + content: "\f6f4"; +} + +.bi-usb-mini-fill::before { + content: "\f6f5"; +} + +.bi-usb-mini::before { + content: "\f6f6"; +} + +.bi-cloud-haze2::before { + content: "\f6f7"; +} + +.bi-device-hdd-fill::before { + content: "\f6f8"; +} + +.bi-device-hdd::before { + content: "\f6f9"; +} + +.bi-device-ssd-fill::before { + content: "\f6fa"; +} + +.bi-device-ssd::before { + content: "\f6fb"; +} + +.bi-displayport-fill::before { + content: "\f6fc"; +} + +.bi-mortarboard-fill::before { + content: "\f6fd"; +} + +.bi-mortarboard::before { + content: "\f6fe"; +} + +.bi-terminal-x::before { + content: "\f6ff"; +} + +.bi-arrow-through-heart-fill::before { + content: "\f700"; +} + +.bi-arrow-through-heart::before { + content: "\f701"; +} + +.bi-badge-sd-fill::before { + content: "\f702"; +} + +.bi-badge-sd::before { + content: "\f703"; +} + +.bi-bag-heart-fill::before { + content: "\f704"; +} + +.bi-bag-heart::before { + content: "\f705"; +} + +.bi-balloon-fill::before { + content: "\f706"; +} + +.bi-balloon-heart-fill::before { + content: "\f707"; +} + +.bi-balloon-heart::before { + content: "\f708"; +} + +.bi-balloon::before { + content: "\f709"; +} + +.bi-box2-fill::before { + content: "\f70a"; +} + +.bi-box2-heart-fill::before { + content: "\f70b"; +} + +.bi-box2-heart::before { + content: "\f70c"; +} + +.bi-box2::before { + content: "\f70d"; +} + +.bi-braces-asterisk::before { + content: "\f70e"; +} + +.bi-calendar-heart-fill::before { + content: "\f70f"; +} + +.bi-calendar-heart::before { + content: "\f710"; +} + +.bi-calendar2-heart-fill::before { + content: "\f711"; +} + +.bi-calendar2-heart::before { + content: "\f712"; +} + +.bi-chat-heart-fill::before { + content: "\f713"; +} + +.bi-chat-heart::before { + content: "\f714"; +} + +.bi-chat-left-heart-fill::before { + content: "\f715"; +} + +.bi-chat-left-heart::before { + content: "\f716"; +} + +.bi-chat-right-heart-fill::before { + content: "\f717"; +} + +.bi-chat-right-heart::before { + content: "\f718"; +} + +.bi-chat-square-heart-fill::before { + content: "\f719"; +} + +.bi-chat-square-heart::before { + content: "\f71a"; +} + +.bi-clipboard-check-fill::before { + content: "\f71b"; +} + +.bi-clipboard-data-fill::before { + content: "\f71c"; +} + +.bi-clipboard-fill::before { + content: "\f71d"; +} + +.bi-clipboard-heart-fill::before { + content: "\f71e"; +} + +.bi-clipboard-heart::before { + content: "\f71f"; +} + +.bi-clipboard-minus-fill::before { + content: "\f720"; +} + +.bi-clipboard-plus-fill::before { + content: "\f721"; +} + +.bi-clipboard-pulse::before { + content: "\f722"; +} + +.bi-clipboard-x-fill::before { + content: "\f723"; +} + +.bi-clipboard2-check-fill::before { + content: "\f724"; +} + +.bi-clipboard2-check::before { + content: "\f725"; +} + +.bi-clipboard2-data-fill::before { + content: "\f726"; +} + +.bi-clipboard2-data::before { + content: "\f727"; +} + +.bi-clipboard2-fill::before { + content: "\f728"; +} + +.bi-clipboard2-heart-fill::before { + content: "\f729"; +} + +.bi-clipboard2-heart::before { + content: "\f72a"; +} + +.bi-clipboard2-minus-fill::before { + content: "\f72b"; +} + +.bi-clipboard2-minus::before { + content: "\f72c"; +} + +.bi-clipboard2-plus-fill::before { + content: "\f72d"; +} + +.bi-clipboard2-plus::before { + content: "\f72e"; +} + +.bi-clipboard2-pulse-fill::before { + content: "\f72f"; +} + +.bi-clipboard2-pulse::before { + content: "\f730"; +} + +.bi-clipboard2-x-fill::before { + content: "\f731"; +} + +.bi-clipboard2-x::before { + content: "\f732"; +} + +.bi-clipboard2::before { + content: "\f733"; +} + +.bi-emoji-kiss-fill::before { + content: "\f734"; +} + +.bi-emoji-kiss::before { + content: "\f735"; +} + +.bi-envelope-heart-fill::before { + content: "\f736"; +} + +.bi-envelope-heart::before { + content: "\f737"; +} + +.bi-envelope-open-heart-fill::before { + content: "\f738"; +} + +.bi-envelope-open-heart::before { + content: "\f739"; +} + +.bi-envelope-paper-fill::before { + content: "\f73a"; +} + +.bi-envelope-paper-heart-fill::before { + content: "\f73b"; +} + +.bi-envelope-paper-heart::before { + content: "\f73c"; +} + +.bi-envelope-paper::before { + content: "\f73d"; +} + +.bi-filetype-aac::before { + content: "\f73e"; +} + +.bi-filetype-ai::before { + content: "\f73f"; +} + +.bi-filetype-bmp::before { + content: "\f740"; +} + +.bi-filetype-cs::before { + content: "\f741"; +} + +.bi-filetype-css::before { + content: "\f742"; +} + +.bi-filetype-csv::before { + content: "\f743"; +} + +.bi-filetype-doc::before { + content: "\f744"; +} + +.bi-filetype-docx::before { + content: "\f745"; +} + +.bi-filetype-exe::before { + content: "\f746"; +} + +.bi-filetype-gif::before { + content: "\f747"; +} + +.bi-filetype-heic::before { + content: "\f748"; +} + +.bi-filetype-html::before { + content: "\f749"; +} + +.bi-filetype-java::before { + content: "\f74a"; +} + +.bi-filetype-jpg::before { + content: "\f74b"; +} + +.bi-filetype-js::before { + content: "\f74c"; +} + +.bi-filetype-jsx::before { + content: "\f74d"; +} + +.bi-filetype-key::before { + content: "\f74e"; +} + +.bi-filetype-m4p::before { + content: "\f74f"; +} + +.bi-filetype-md::before { + content: "\f750"; +} + +.bi-filetype-mdx::before { + content: "\f751"; +} + +.bi-filetype-mov::before { + content: "\f752"; +} + +.bi-filetype-mp3::before { + content: "\f753"; +} + +.bi-filetype-mp4::before { + content: "\f754"; +} + +.bi-filetype-otf::before { + content: "\f755"; +} + +.bi-filetype-pdf::before { + content: "\f756"; +} + +.bi-filetype-php::before { + content: "\f757"; +} + +.bi-filetype-png::before { + content: "\f758"; +} + +.bi-filetype-ppt-1::before { + content: "\f759"; +} + +.bi-filetype-ppt::before { + content: "\f75a"; +} + +.bi-filetype-psd::before { + content: "\f75b"; +} + +.bi-filetype-py::before { + content: "\f75c"; +} + +.bi-filetype-raw::before { + content: "\f75d"; +} + +.bi-filetype-rb::before { + content: "\f75e"; +} + +.bi-filetype-sass::before { + content: "\f75f"; +} + +.bi-filetype-scss::before { + content: "\f760"; +} + +.bi-filetype-sh::before { + content: "\f761"; +} + +.bi-filetype-svg::before { + content: "\f762"; +} + +.bi-filetype-tiff::before { + content: "\f763"; +} + +.bi-filetype-tsx::before { + content: "\f764"; +} + +.bi-filetype-ttf::before { + content: "\f765"; +} + +.bi-filetype-txt::before { + content: "\f766"; +} + +.bi-filetype-wav::before { + content: "\f767"; +} + +.bi-filetype-woff::before { + content: "\f768"; +} + +.bi-filetype-xls-1::before { + content: "\f769"; +} + +.bi-filetype-xls::before { + content: "\f76a"; +} + +.bi-filetype-xml::before { + content: "\f76b"; +} + +.bi-filetype-yml::before { + content: "\f76c"; +} + +.bi-heart-arrow::before { + content: "\f76d"; +} + +.bi-heart-pulse-fill::before { + content: "\f76e"; +} + +.bi-heart-pulse::before { + content: "\f76f"; +} + +.bi-heartbreak-fill::before { + content: "\f770"; +} + +.bi-heartbreak::before { + content: "\f771"; +} + +.bi-hearts::before { + content: "\f772"; +} + +.bi-hospital-fill::before { + content: "\f773"; +} + +.bi-hospital::before { + content: "\f774"; +} + +.bi-house-heart-fill::before { + content: "\f775"; +} + +.bi-house-heart::before { + content: "\f776"; +} + +.bi-incognito::before { + content: "\f777"; +} + +.bi-magnet-fill::before { + content: "\f778"; +} + +.bi-magnet::before { + content: "\f779"; +} + +.bi-person-heart::before { + content: "\f77a"; +} + +.bi-person-hearts::before { + content: "\f77b"; +} + +.bi-phone-flip::before { + content: "\f77c"; +} + +.bi-plugin::before { + content: "\f77d"; +} + +.bi-postage-fill::before { + content: "\f77e"; +} + +.bi-postage-heart-fill::before { + content: "\f77f"; +} + +.bi-postage-heart::before { + content: "\f780"; +} + +.bi-postage::before { + content: "\f781"; +} + +.bi-postcard-fill::before { + content: "\f782"; +} + +.bi-postcard-heart-fill::before { + content: "\f783"; +} + +.bi-postcard-heart::before { + content: "\f784"; +} + +.bi-postcard::before { + content: "\f785"; +} + +.bi-search-heart-fill::before { + content: "\f786"; +} + +.bi-search-heart::before { + content: "\f787"; +} + +.bi-sliders2-vertical::before { + content: "\f788"; +} + +.bi-sliders2::before { + content: "\f789"; +} + +.bi-trash3-fill::before { + content: "\f78a"; +} + +.bi-trash3::before { + content: "\f78b"; +} + +.bi-valentine::before { + content: "\f78c"; +} + +.bi-valentine2::before { + content: "\f78d"; +} + +.bi-wrench-adjustable-circle-fill::before { + content: "\f78e"; +} + +.bi-wrench-adjustable-circle::before { + content: "\f78f"; +} + +.bi-wrench-adjustable::before { + content: "\f790"; +} + +.bi-filetype-json::before { + content: "\f791"; +} + +.bi-filetype-pptx::before { + content: "\f792"; +} + +.bi-filetype-xlsx::before { + content: "\f793"; +} diff --git a/admin/src/main/resources/static/library/bootstrap/bootstrap.js.map b/admin/src/main/resources/static/library/bootstrap/bootstrap.js.map new file mode 100644 index 00000000..51fbcc22 --- /dev/null +++ b/admin/src/main/resources/static/library/bootstrap/bootstrap.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bootstrap.js","sources":["../../js/src/util/index.js","../../js/src/dom/event-handler.js","../../js/src/dom/data.js","../../js/src/base-component.js","../../js/src/util/component-functions.js","../../js/src/alert.js","../../js/src/button.js","../../js/src/dom/manipulator.js","../../js/src/dom/selector-engine.js","../../js/src/carousel.js","../../js/src/collapse.js","../../js/src/dropdown.js","../../js/src/util/scrollbar.js","../../js/src/util/backdrop.js","../../js/src/util/focustrap.js","../../js/src/modal.js","../../js/src/offcanvas.js","../../js/src/util/sanitizer.js","../../js/src/tooltip.js","../../js/src/popover.js","../../js/src/scrollspy.js","../../js/src/tab.js","../../js/src/toast.js","../../js/index.umd.js"],"sourcesContent":["/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/index.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst MAX_UID = 1000000\nconst MILLISECONDS_MULTIPLIER = 1000\nconst TRANSITION_END = 'transitionend'\n\n// Shoutout AngusCroll (https://goo.gl/pxwQGp)\nconst toType = obj => {\n if (obj === null || obj === undefined) {\n return `${obj}`\n }\n\n return {}.toString.call(obj).match(/\\s([a-z]+)/i)[1].toLowerCase()\n}\n\n/**\n * --------------------------------------------------------------------------\n * Public Util Api\n * --------------------------------------------------------------------------\n */\n\nconst getUID = prefix => {\n do {\n prefix += Math.floor(Math.random() * MAX_UID)\n } while (document.getElementById(prefix))\n\n return prefix\n}\n\nconst getSelector = element => {\n let selector = element.getAttribute('data-bs-target')\n\n if (!selector || selector === '#') {\n let hrefAttr = element.getAttribute('href')\n\n // The only valid content that could double as a selector are IDs or classes,\n // so everything starting with `#` or `.`. If a \"real\" URL is used as the selector,\n // `document.querySelector` will rightfully complain it is invalid.\n // See https://github.com/twbs/bootstrap/issues/32273\n if (!hrefAttr || (!hrefAttr.includes('#') && !hrefAttr.startsWith('.'))) {\n return null\n }\n\n // Just in case some CMS puts out a full URL with the anchor appended\n if (hrefAttr.includes('#') && !hrefAttr.startsWith('#')) {\n hrefAttr = `#${hrefAttr.split('#')[1]}`\n }\n\n selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : null\n }\n\n return selector\n}\n\nconst getSelectorFromElement = element => {\n const selector = getSelector(element)\n\n if (selector) {\n return document.querySelector(selector) ? selector : null\n }\n\n return null\n}\n\nconst getElementFromSelector = element => {\n const selector = getSelector(element)\n\n return selector ? document.querySelector(selector) : null\n}\n\nconst getTransitionDurationFromElement = element => {\n if (!element) {\n return 0\n }\n\n // Get transition-duration of the element\n let { transitionDuration, transitionDelay } = window.getComputedStyle(element)\n\n const floatTransitionDuration = Number.parseFloat(transitionDuration)\n const floatTransitionDelay = Number.parseFloat(transitionDelay)\n\n // Return 0 if element or transition duration is not found\n if (!floatTransitionDuration && !floatTransitionDelay) {\n return 0\n }\n\n // If multiple durations are defined, take the first\n transitionDuration = transitionDuration.split(',')[0]\n transitionDelay = transitionDelay.split(',')[0]\n\n return (Number.parseFloat(transitionDuration) + Number.parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER\n}\n\nconst triggerTransitionEnd = element => {\n element.dispatchEvent(new Event(TRANSITION_END))\n}\n\nconst isElement = obj => {\n if (!obj || typeof obj !== 'object') {\n return false\n }\n\n if (typeof obj.jquery !== 'undefined') {\n obj = obj[0]\n }\n\n return typeof obj.nodeType !== 'undefined'\n}\n\nconst getElement = obj => {\n if (isElement(obj)) { // it's a jQuery object or a node element\n return obj.jquery ? obj[0] : obj\n }\n\n if (typeof obj === 'string' && obj.length > 0) {\n return document.querySelector(obj)\n }\n\n return null\n}\n\nconst typeCheckConfig = (componentName, config, configTypes) => {\n Object.keys(configTypes).forEach(property => {\n const expectedTypes = configTypes[property]\n const value = config[property]\n const valueType = value && isElement(value) ? 'element' : toType(value)\n\n if (!new RegExp(expectedTypes).test(valueType)) {\n throw new TypeError(\n `${componentName.toUpperCase()}: Option \"${property}\" provided type \"${valueType}\" but expected type \"${expectedTypes}\".`\n )\n }\n })\n}\n\nconst isVisible = element => {\n if (!isElement(element) || element.getClientRects().length === 0) {\n return false\n }\n\n return getComputedStyle(element).getPropertyValue('visibility') === 'visible'\n}\n\nconst isDisabled = element => {\n if (!element || element.nodeType !== Node.ELEMENT_NODE) {\n return true\n }\n\n if (element.classList.contains('disabled')) {\n return true\n }\n\n if (typeof element.disabled !== 'undefined') {\n return element.disabled\n }\n\n return element.hasAttribute('disabled') && element.getAttribute('disabled') !== 'false'\n}\n\nconst findShadowRoot = element => {\n if (!document.documentElement.attachShadow) {\n return null\n }\n\n // Can find the shadow root otherwise it'll return the document\n if (typeof element.getRootNode === 'function') {\n const root = element.getRootNode()\n return root instanceof ShadowRoot ? root : null\n }\n\n if (element instanceof ShadowRoot) {\n return element\n }\n\n // when we don't find a shadow root\n if (!element.parentNode) {\n return null\n }\n\n return findShadowRoot(element.parentNode)\n}\n\nconst noop = () => {}\n\n/**\n * Trick to restart an element's animation\n *\n * @param {HTMLElement} element\n * @return void\n *\n * @see https://www.charistheo.io/blog/2021/02/restart-a-css-animation-with-javascript/#restarting-a-css-animation\n */\nconst reflow = element => {\n // eslint-disable-next-line no-unused-expressions\n element.offsetHeight\n}\n\nconst getjQuery = () => {\n const { jQuery } = window\n\n if (jQuery && !document.body.hasAttribute('data-bs-no-jquery')) {\n return jQuery\n }\n\n return null\n}\n\nconst DOMContentLoadedCallbacks = []\n\nconst onDOMContentLoaded = callback => {\n if (document.readyState === 'loading') {\n // add listener on the first call when the document is in loading state\n if (!DOMContentLoadedCallbacks.length) {\n document.addEventListener('DOMContentLoaded', () => {\n DOMContentLoadedCallbacks.forEach(callback => callback())\n })\n }\n\n DOMContentLoadedCallbacks.push(callback)\n } else {\n callback()\n }\n}\n\nconst isRTL = () => document.documentElement.dir === 'rtl'\n\nconst defineJQueryPlugin = plugin => {\n onDOMContentLoaded(() => {\n const $ = getjQuery()\n /* istanbul ignore if */\n if ($) {\n const name = plugin.NAME\n const JQUERY_NO_CONFLICT = $.fn[name]\n $.fn[name] = plugin.jQueryInterface\n $.fn[name].Constructor = plugin\n $.fn[name].noConflict = () => {\n $.fn[name] = JQUERY_NO_CONFLICT\n return plugin.jQueryInterface\n }\n }\n })\n}\n\nconst execute = callback => {\n if (typeof callback === 'function') {\n callback()\n }\n}\n\nconst executeAfterTransition = (callback, transitionElement, waitForTransition = true) => {\n if (!waitForTransition) {\n execute(callback)\n return\n }\n\n const durationPadding = 5\n const emulatedDuration = getTransitionDurationFromElement(transitionElement) + durationPadding\n\n let called = false\n\n const handler = ({ target }) => {\n if (target !== transitionElement) {\n return\n }\n\n called = true\n transitionElement.removeEventListener(TRANSITION_END, handler)\n execute(callback)\n }\n\n transitionElement.addEventListener(TRANSITION_END, handler)\n setTimeout(() => {\n if (!called) {\n triggerTransitionEnd(transitionElement)\n }\n }, emulatedDuration)\n}\n\n/**\n * Return the previous/next element of a list.\n *\n * @param {array} list The list of elements\n * @param activeElement The active element\n * @param shouldGetNext Choose to get next or previous element\n * @param isCycleAllowed\n * @return {Element|elem} The proper element\n */\nconst getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {\n let index = list.indexOf(activeElement)\n\n // if the element does not exist in the list return an element depending on the direction and if cycle is allowed\n if (index === -1) {\n return list[!shouldGetNext && isCycleAllowed ? list.length - 1 : 0]\n }\n\n const listLength = list.length\n\n index += shouldGetNext ? 1 : -1\n\n if (isCycleAllowed) {\n index = (index + listLength) % listLength\n }\n\n return list[Math.max(0, Math.min(index, listLength - 1))]\n}\n\nexport {\n getElement,\n getUID,\n getSelectorFromElement,\n getElementFromSelector,\n getTransitionDurationFromElement,\n triggerTransitionEnd,\n isElement,\n typeCheckConfig,\n isVisible,\n isDisabled,\n findShadowRoot,\n noop,\n getNextActiveElement,\n reflow,\n getjQuery,\n onDOMContentLoaded,\n isRTL,\n defineJQueryPlugin,\n execute,\n executeAfterTransition\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/event-handler.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { getjQuery } from '../util/index'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst namespaceRegex = /[^.]*(?=\\..*)\\.|.*/\nconst stripNameRegex = /\\..*/\nconst stripUidRegex = /::\\d+$/\nconst eventRegistry = {} // Events storage\nlet uidEvent = 1\nconst customEvents = {\n mouseenter: 'mouseover',\n mouseleave: 'mouseout'\n}\nconst customEventsRegex = /^(mouseenter|mouseleave)/i\nconst nativeEvents = new Set([\n 'click',\n 'dblclick',\n 'mouseup',\n 'mousedown',\n 'contextmenu',\n 'mousewheel',\n 'DOMMouseScroll',\n 'mouseover',\n 'mouseout',\n 'mousemove',\n 'selectstart',\n 'selectend',\n 'keydown',\n 'keypress',\n 'keyup',\n 'orientationchange',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'touchcancel',\n 'pointerdown',\n 'pointermove',\n 'pointerup',\n 'pointerleave',\n 'pointercancel',\n 'gesturestart',\n 'gesturechange',\n 'gestureend',\n 'focus',\n 'blur',\n 'change',\n 'reset',\n 'select',\n 'submit',\n 'focusin',\n 'focusout',\n 'load',\n 'unload',\n 'beforeunload',\n 'resize',\n 'move',\n 'DOMContentLoaded',\n 'readystatechange',\n 'error',\n 'abort',\n 'scroll'\n])\n\n/**\n * ------------------------------------------------------------------------\n * Private methods\n * ------------------------------------------------------------------------\n */\n\nfunction getUidEvent(element, uid) {\n return (uid && `${uid}::${uidEvent++}`) || element.uidEvent || uidEvent++\n}\n\nfunction getEvent(element) {\n const uid = getUidEvent(element)\n\n element.uidEvent = uid\n eventRegistry[uid] = eventRegistry[uid] || {}\n\n return eventRegistry[uid]\n}\n\nfunction bootstrapHandler(element, fn) {\n return function handler(event) {\n event.delegateTarget = element\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, fn)\n }\n\n return fn.apply(element, [event])\n }\n}\n\nfunction bootstrapDelegationHandler(element, selector, fn) {\n return function handler(event) {\n const domElements = element.querySelectorAll(selector)\n\n for (let { target } = event; target && target !== this; target = target.parentNode) {\n for (let i = domElements.length; i--;) {\n if (domElements[i] === target) {\n event.delegateTarget = target\n\n if (handler.oneOff) {\n EventHandler.off(element, event.type, selector, fn)\n }\n\n return fn.apply(target, [event])\n }\n }\n }\n\n // To please ESLint\n return null\n }\n}\n\nfunction findHandler(events, handler, delegationSelector = null) {\n const uidEventList = Object.keys(events)\n\n for (let i = 0, len = uidEventList.length; i < len; i++) {\n const event = events[uidEventList[i]]\n\n if (event.originalHandler === handler && event.delegationSelector === delegationSelector) {\n return event\n }\n }\n\n return null\n}\n\nfunction normalizeParams(originalTypeEvent, handler, delegationFn) {\n const delegation = typeof handler === 'string'\n const originalHandler = delegation ? delegationFn : handler\n\n let typeEvent = getTypeEvent(originalTypeEvent)\n const isNative = nativeEvents.has(typeEvent)\n\n if (!isNative) {\n typeEvent = originalTypeEvent\n }\n\n return [delegation, originalHandler, typeEvent]\n}\n\nfunction addHandler(element, originalTypeEvent, handler, delegationFn, oneOff) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n if (!handler) {\n handler = delegationFn\n delegationFn = null\n }\n\n // in case of mouseenter or mouseleave wrap the handler within a function that checks for its DOM position\n // this prevents the handler from being dispatched the same way as mouseover or mouseout does\n if (customEventsRegex.test(originalTypeEvent)) {\n const wrapFn = fn => {\n return function (event) {\n if (!event.relatedTarget || (event.relatedTarget !== event.delegateTarget && !event.delegateTarget.contains(event.relatedTarget))) {\n return fn.call(this, event)\n }\n }\n }\n\n if (delegationFn) {\n delegationFn = wrapFn(delegationFn)\n } else {\n handler = wrapFn(handler)\n }\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)\n const events = getEvent(element)\n const handlers = events[typeEvent] || (events[typeEvent] = {})\n const previousFn = findHandler(handlers, originalHandler, delegation ? handler : null)\n\n if (previousFn) {\n previousFn.oneOff = previousFn.oneOff && oneOff\n\n return\n }\n\n const uid = getUidEvent(originalHandler, originalTypeEvent.replace(namespaceRegex, ''))\n const fn = delegation ?\n bootstrapDelegationHandler(element, handler, delegationFn) :\n bootstrapHandler(element, handler)\n\n fn.delegationSelector = delegation ? handler : null\n fn.originalHandler = originalHandler\n fn.oneOff = oneOff\n fn.uidEvent = uid\n handlers[uid] = fn\n\n element.addEventListener(typeEvent, fn, delegation)\n}\n\nfunction removeHandler(element, events, typeEvent, handler, delegationSelector) {\n const fn = findHandler(events[typeEvent], handler, delegationSelector)\n\n if (!fn) {\n return\n }\n\n element.removeEventListener(typeEvent, fn, Boolean(delegationSelector))\n delete events[typeEvent][fn.uidEvent]\n}\n\nfunction removeNamespacedHandlers(element, events, typeEvent, namespace) {\n const storeElementEvent = events[typeEvent] || {}\n\n Object.keys(storeElementEvent).forEach(handlerKey => {\n if (handlerKey.includes(namespace)) {\n const event = storeElementEvent[handlerKey]\n\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)\n }\n })\n}\n\nfunction getTypeEvent(event) {\n // allow to get the native events from namespaced events ('click.bs.button' --> 'click')\n event = event.replace(stripNameRegex, '')\n return customEvents[event] || event\n}\n\nconst EventHandler = {\n on(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, false)\n },\n\n one(element, event, handler, delegationFn) {\n addHandler(element, event, handler, delegationFn, true)\n },\n\n off(element, originalTypeEvent, handler, delegationFn) {\n if (typeof originalTypeEvent !== 'string' || !element) {\n return\n }\n\n const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)\n const inNamespace = typeEvent !== originalTypeEvent\n const events = getEvent(element)\n const isNamespace = originalTypeEvent.startsWith('.')\n\n if (typeof originalHandler !== 'undefined') {\n // Simplest case: handler is passed, remove that listener ONLY.\n if (!events || !events[typeEvent]) {\n return\n }\n\n removeHandler(element, events, typeEvent, originalHandler, delegation ? handler : null)\n return\n }\n\n if (isNamespace) {\n Object.keys(events).forEach(elementEvent => {\n removeNamespacedHandlers(element, events, elementEvent, originalTypeEvent.slice(1))\n })\n }\n\n const storeElementEvent = events[typeEvent] || {}\n Object.keys(storeElementEvent).forEach(keyHandlers => {\n const handlerKey = keyHandlers.replace(stripUidRegex, '')\n\n if (!inNamespace || originalTypeEvent.includes(handlerKey)) {\n const event = storeElementEvent[keyHandlers]\n\n removeHandler(element, events, typeEvent, event.originalHandler, event.delegationSelector)\n }\n })\n },\n\n trigger(element, event, args) {\n if (typeof event !== 'string' || !element) {\n return null\n }\n\n const $ = getjQuery()\n const typeEvent = getTypeEvent(event)\n const inNamespace = event !== typeEvent\n const isNative = nativeEvents.has(typeEvent)\n\n let jQueryEvent\n let bubbles = true\n let nativeDispatch = true\n let defaultPrevented = false\n let evt = null\n\n if (inNamespace && $) {\n jQueryEvent = $.Event(event, args)\n\n $(element).trigger(jQueryEvent)\n bubbles = !jQueryEvent.isPropagationStopped()\n nativeDispatch = !jQueryEvent.isImmediatePropagationStopped()\n defaultPrevented = jQueryEvent.isDefaultPrevented()\n }\n\n if (isNative) {\n evt = document.createEvent('HTMLEvents')\n evt.initEvent(typeEvent, bubbles, true)\n } else {\n evt = new CustomEvent(event, {\n bubbles,\n cancelable: true\n })\n }\n\n // merge custom information in our event\n if (typeof args !== 'undefined') {\n Object.keys(args).forEach(key => {\n Object.defineProperty(evt, key, {\n get() {\n return args[key]\n }\n })\n })\n }\n\n if (defaultPrevented) {\n evt.preventDefault()\n }\n\n if (nativeDispatch) {\n element.dispatchEvent(evt)\n }\n\n if (evt.defaultPrevented && typeof jQueryEvent !== 'undefined') {\n jQueryEvent.preventDefault()\n }\n\n return evt\n }\n}\n\nexport default EventHandler\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/data.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst elementMap = new Map()\n\nexport default {\n set(element, key, instance) {\n if (!elementMap.has(element)) {\n elementMap.set(element, new Map())\n }\n\n const instanceMap = elementMap.get(element)\n\n // make it clear we only want one instance per element\n // can be removed later when multiple key/instances are fine to be used\n if (!instanceMap.has(key) && instanceMap.size !== 0) {\n // eslint-disable-next-line no-console\n console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(instanceMap.keys())[0]}.`)\n return\n }\n\n instanceMap.set(key, instance)\n },\n\n get(element, key) {\n if (elementMap.has(element)) {\n return elementMap.get(element).get(key) || null\n }\n\n return null\n },\n\n remove(element, key) {\n if (!elementMap.has(element)) {\n return\n }\n\n const instanceMap = elementMap.get(element)\n\n instanceMap.delete(key)\n\n // free up element references if there are no instances left for an element\n if (instanceMap.size === 0) {\n elementMap.delete(element)\n }\n }\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): base-component.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport Data from './dom/data'\nimport {\n executeAfterTransition,\n getElement\n} from './util/index'\nimport EventHandler from './dom/event-handler'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst VERSION = '5.1.3'\n\nclass BaseComponent {\n constructor(element) {\n element = getElement(element)\n\n if (!element) {\n return\n }\n\n this._element = element\n Data.set(this._element, this.constructor.DATA_KEY, this)\n }\n\n dispose() {\n Data.remove(this._element, this.constructor.DATA_KEY)\n EventHandler.off(this._element, this.constructor.EVENT_KEY)\n\n Object.getOwnPropertyNames(this).forEach(propertyName => {\n this[propertyName] = null\n })\n }\n\n _queueCallback(callback, element, isAnimated = true) {\n executeAfterTransition(callback, element, isAnimated)\n }\n\n /** Static */\n\n static getInstance(element) {\n return Data.get(getElement(element), this.DATA_KEY)\n }\n\n static getOrCreateInstance(element, config = {}) {\n return this.getInstance(element) || new this(element, typeof config === 'object' ? config : null)\n }\n\n static get VERSION() {\n return VERSION\n }\n\n static get NAME() {\n throw new Error('You have to implement the static method \"NAME\", for each component!')\n }\n\n static get DATA_KEY() {\n return `bs.${this.NAME}`\n }\n\n static get EVENT_KEY() {\n return `.${this.DATA_KEY}`\n }\n}\n\nexport default BaseComponent\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/component-functions.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler'\nimport { getElementFromSelector, isDisabled } from './index'\n\nconst enableDismissTrigger = (component, method = 'hide') => {\n const clickEvent = `click.dismiss${component.EVENT_KEY}`\n const name = component.NAME\n\n EventHandler.on(document, clickEvent, `[data-bs-dismiss=\"${name}\"]`, function (event) {\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n if (isDisabled(this)) {\n return\n }\n\n const target = getElementFromSelector(this) || this.closest(`.${name}`)\n const instance = component.getOrCreateInstance(target)\n\n // Method argument is left, for Alert and only, as it doesn't implement the 'hide' method\n instance[method]()\n })\n}\n\nexport {\n enableDismissTrigger\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): alert.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { defineJQueryPlugin } from './util/index'\nimport EventHandler from './dom/event-handler'\nimport BaseComponent from './base-component'\nimport { enableDismissTrigger } from './util/component-functions'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'alert'\nconst DATA_KEY = 'bs.alert'\nconst EVENT_KEY = `.${DATA_KEY}`\n\nconst EVENT_CLOSE = `close${EVENT_KEY}`\nconst EVENT_CLOSED = `closed${EVENT_KEY}`\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Alert extends BaseComponent {\n // Getters\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n close() {\n const closeEvent = EventHandler.trigger(this._element, EVENT_CLOSE)\n\n if (closeEvent.defaultPrevented) {\n return\n }\n\n this._element.classList.remove(CLASS_NAME_SHOW)\n\n const isAnimated = this._element.classList.contains(CLASS_NAME_FADE)\n this._queueCallback(() => this._destroyElement(), this._element, isAnimated)\n }\n\n // Private\n _destroyElement() {\n this._element.remove()\n EventHandler.trigger(this._element, EVENT_CLOSED)\n this.dispose()\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Alert.getOrCreateInstance(this)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nenableDismissTrigger(Alert, 'close')\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Alert to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Alert)\n\nexport default Alert\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): button.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { defineJQueryPlugin } from './util/index'\nimport EventHandler from './dom/event-handler'\nimport BaseComponent from './base-component'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'button'\nconst DATA_KEY = 'bs.button'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst CLASS_NAME_ACTIVE = 'active'\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"button\"]'\n\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Button extends BaseComponent {\n // Getters\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n toggle() {\n // Toggle class and sync the `aria-pressed` attribute with the return value of the `.toggle()` method\n this._element.setAttribute('aria-pressed', this._element.classList.toggle(CLASS_NAME_ACTIVE))\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Button.getOrCreateInstance(this)\n\n if (config === 'toggle') {\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, event => {\n event.preventDefault()\n\n const button = event.target.closest(SELECTOR_DATA_TOGGLE)\n const data = Button.getOrCreateInstance(button)\n\n data.toggle()\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Button to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Button)\n\nexport default Button\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/manipulator.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nfunction normalizeData(val) {\n if (val === 'true') {\n return true\n }\n\n if (val === 'false') {\n return false\n }\n\n if (val === Number(val).toString()) {\n return Number(val)\n }\n\n if (val === '' || val === 'null') {\n return null\n }\n\n return val\n}\n\nfunction normalizeDataKey(key) {\n return key.replace(/[A-Z]/g, chr => `-${chr.toLowerCase()}`)\n}\n\nconst Manipulator = {\n setDataAttribute(element, key, value) {\n element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)\n },\n\n removeDataAttribute(element, key) {\n element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)\n },\n\n getDataAttributes(element) {\n if (!element) {\n return {}\n }\n\n const attributes = {}\n\n Object.keys(element.dataset)\n .filter(key => key.startsWith('bs'))\n .forEach(key => {\n let pureKey = key.replace(/^bs/, '')\n pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)\n attributes[pureKey] = normalizeData(element.dataset[key])\n })\n\n return attributes\n },\n\n getDataAttribute(element, key) {\n return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))\n },\n\n offset(element) {\n const rect = element.getBoundingClientRect()\n\n return {\n top: rect.top + window.pageYOffset,\n left: rect.left + window.pageXOffset\n }\n },\n\n position(element) {\n return {\n top: element.offsetTop,\n left: element.offsetLeft\n }\n }\n}\n\nexport default Manipulator\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dom/selector-engine.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nimport { isDisabled, isVisible } from '../util/index'\n\nconst NODE_TEXT = 3\n\nconst SelectorEngine = {\n find(selector, element = document.documentElement) {\n return [].concat(...Element.prototype.querySelectorAll.call(element, selector))\n },\n\n findOne(selector, element = document.documentElement) {\n return Element.prototype.querySelector.call(element, selector)\n },\n\n children(element, selector) {\n return [].concat(...element.children)\n .filter(child => child.matches(selector))\n },\n\n parents(element, selector) {\n const parents = []\n\n let ancestor = element.parentNode\n\n while (ancestor && ancestor.nodeType === Node.ELEMENT_NODE && ancestor.nodeType !== NODE_TEXT) {\n if (ancestor.matches(selector)) {\n parents.push(ancestor)\n }\n\n ancestor = ancestor.parentNode\n }\n\n return parents\n },\n\n prev(element, selector) {\n let previous = element.previousElementSibling\n\n while (previous) {\n if (previous.matches(selector)) {\n return [previous]\n }\n\n previous = previous.previousElementSibling\n }\n\n return []\n },\n\n next(element, selector) {\n let next = element.nextElementSibling\n\n while (next) {\n if (next.matches(selector)) {\n return [next]\n }\n\n next = next.nextElementSibling\n }\n\n return []\n },\n\n focusableChildren(element) {\n const focusables = [\n 'a',\n 'button',\n 'input',\n 'textarea',\n 'select',\n 'details',\n '[tabindex]',\n '[contenteditable=\"true\"]'\n ].map(selector => `${selector}:not([tabindex^=\"-\"])`).join(', ')\n\n return this.find(focusables, element).filter(el => !isDisabled(el) && isVisible(el))\n }\n}\n\nexport default SelectorEngine\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): carousel.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n defineJQueryPlugin,\n getElementFromSelector,\n isRTL,\n isVisible,\n getNextActiveElement,\n reflow,\n triggerTransitionEnd,\n typeCheckConfig\n} from './util/index'\nimport EventHandler from './dom/event-handler'\nimport Manipulator from './dom/manipulator'\nimport SelectorEngine from './dom/selector-engine'\nimport BaseComponent from './base-component'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'carousel'\nconst DATA_KEY = 'bs.carousel'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ARROW_LEFT_KEY = 'ArrowLeft'\nconst ARROW_RIGHT_KEY = 'ArrowRight'\nconst TOUCHEVENT_COMPAT_WAIT = 500 // Time for mouse compat events to fire after touch\nconst SWIPE_THRESHOLD = 40\n\nconst Default = {\n interval: 5000,\n keyboard: true,\n slide: false,\n pause: 'hover',\n wrap: true,\n touch: true\n}\n\nconst DefaultType = {\n interval: '(number|boolean)',\n keyboard: 'boolean',\n slide: '(boolean|string)',\n pause: '(string|boolean)',\n wrap: 'boolean',\n touch: 'boolean'\n}\n\nconst ORDER_NEXT = 'next'\nconst ORDER_PREV = 'prev'\nconst DIRECTION_LEFT = 'left'\nconst DIRECTION_RIGHT = 'right'\n\nconst KEY_TO_DIRECTION = {\n [ARROW_LEFT_KEY]: DIRECTION_RIGHT,\n [ARROW_RIGHT_KEY]: DIRECTION_LEFT\n}\n\nconst EVENT_SLIDE = `slide${EVENT_KEY}`\nconst EVENT_SLID = `slid${EVENT_KEY}`\nconst EVENT_KEYDOWN = `keydown${EVENT_KEY}`\nconst EVENT_MOUSEENTER = `mouseenter${EVENT_KEY}`\nconst EVENT_MOUSELEAVE = `mouseleave${EVENT_KEY}`\nconst EVENT_TOUCHSTART = `touchstart${EVENT_KEY}`\nconst EVENT_TOUCHMOVE = `touchmove${EVENT_KEY}`\nconst EVENT_TOUCHEND = `touchend${EVENT_KEY}`\nconst EVENT_POINTERDOWN = `pointerdown${EVENT_KEY}`\nconst EVENT_POINTERUP = `pointerup${EVENT_KEY}`\nconst EVENT_DRAG_START = `dragstart${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_CAROUSEL = 'carousel'\nconst CLASS_NAME_ACTIVE = 'active'\nconst CLASS_NAME_SLIDE = 'slide'\nconst CLASS_NAME_END = 'carousel-item-end'\nconst CLASS_NAME_START = 'carousel-item-start'\nconst CLASS_NAME_NEXT = 'carousel-item-next'\nconst CLASS_NAME_PREV = 'carousel-item-prev'\nconst CLASS_NAME_POINTER_EVENT = 'pointer-event'\n\nconst SELECTOR_ACTIVE = '.active'\nconst SELECTOR_ACTIVE_ITEM = '.active.carousel-item'\nconst SELECTOR_ITEM = '.carousel-item'\nconst SELECTOR_ITEM_IMG = '.carousel-item img'\nconst SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'\nconst SELECTOR_INDICATORS = '.carousel-indicators'\nconst SELECTOR_INDICATOR = '[data-bs-target]'\nconst SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'\nconst SELECTOR_DATA_RIDE = '[data-bs-ride=\"carousel\"]'\n\nconst POINTER_TYPE_TOUCH = 'touch'\nconst POINTER_TYPE_PEN = 'pen'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\nclass Carousel extends BaseComponent {\n constructor(element, config) {\n super(element)\n\n this._items = null\n this._interval = null\n this._activeElement = null\n this._isPaused = false\n this._isSliding = false\n this.touchTimeout = null\n this.touchStartX = 0\n this.touchDeltaX = 0\n\n this._config = this._getConfig(config)\n this._indicatorsElement = SelectorEngine.findOne(SELECTOR_INDICATORS, this._element)\n this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0\n this._pointerEvent = Boolean(window.PointerEvent)\n\n this._addEventListeners()\n }\n\n // Getters\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n next() {\n this._slide(ORDER_NEXT)\n }\n\n nextWhenVisible() {\n // Don't call next when the page isn't visible\n // or the carousel or its parent isn't visible\n if (!document.hidden && isVisible(this._element)) {\n this.next()\n }\n }\n\n prev() {\n this._slide(ORDER_PREV)\n }\n\n pause(event) {\n if (!event) {\n this._isPaused = true\n }\n\n if (SelectorEngine.findOne(SELECTOR_NEXT_PREV, this._element)) {\n triggerTransitionEnd(this._element)\n this.cycle(true)\n }\n\n clearInterval(this._interval)\n this._interval = null\n }\n\n cycle(event) {\n if (!event) {\n this._isPaused = false\n }\n\n if (this._interval) {\n clearInterval(this._interval)\n this._interval = null\n }\n\n if (this._config && this._config.interval && !this._isPaused) {\n this._updateInterval()\n\n this._interval = setInterval(\n (document.visibilityState ? this.nextWhenVisible : this.next).bind(this),\n this._config.interval\n )\n }\n }\n\n to(index) {\n this._activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n const activeIndex = this._getItemIndex(this._activeElement)\n\n if (index > this._items.length - 1 || index < 0) {\n return\n }\n\n if (this._isSliding) {\n EventHandler.one(this._element, EVENT_SLID, () => this.to(index))\n return\n }\n\n if (activeIndex === index) {\n this.pause()\n this.cycle()\n return\n }\n\n const order = index > activeIndex ?\n ORDER_NEXT :\n ORDER_PREV\n\n this._slide(order, this._items[index])\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n }\n typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _handleSwipe() {\n const absDeltax = Math.abs(this.touchDeltaX)\n\n if (absDeltax <= SWIPE_THRESHOLD) {\n return\n }\n\n const direction = absDeltax / this.touchDeltaX\n\n this.touchDeltaX = 0\n\n if (!direction) {\n return\n }\n\n this._slide(direction > 0 ? DIRECTION_RIGHT : DIRECTION_LEFT)\n }\n\n _addEventListeners() {\n if (this._config.keyboard) {\n EventHandler.on(this._element, EVENT_KEYDOWN, event => this._keydown(event))\n }\n\n if (this._config.pause === 'hover') {\n EventHandler.on(this._element, EVENT_MOUSEENTER, event => this.pause(event))\n EventHandler.on(this._element, EVENT_MOUSELEAVE, event => this.cycle(event))\n }\n\n if (this._config.touch && this._touchSupported) {\n this._addTouchEventListeners()\n }\n }\n\n _addTouchEventListeners() {\n const hasPointerPenTouch = event => {\n return this._pointerEvent &&\n (event.pointerType === POINTER_TYPE_PEN || event.pointerType === POINTER_TYPE_TOUCH)\n }\n\n const start = event => {\n if (hasPointerPenTouch(event)) {\n this.touchStartX = event.clientX\n } else if (!this._pointerEvent) {\n this.touchStartX = event.touches[0].clientX\n }\n }\n\n const move = event => {\n // ensure swiping with one touch and not pinching\n this.touchDeltaX = event.touches && event.touches.length > 1 ?\n 0 :\n event.touches[0].clientX - this.touchStartX\n }\n\n const end = event => {\n if (hasPointerPenTouch(event)) {\n this.touchDeltaX = event.clientX - this.touchStartX\n }\n\n this._handleSwipe()\n if (this._config.pause === 'hover') {\n // If it's a touch-enabled device, mouseenter/leave are fired as\n // part of the mouse compatibility events on first tap - the carousel\n // would stop cycling until user tapped out of it;\n // here, we listen for touchend, explicitly pause the carousel\n // (as if it's the second time we tap on it, mouseenter compat event\n // is NOT fired) and after a timeout (to allow for mouse compatibility\n // events to fire) we explicitly restart cycling\n\n this.pause()\n if (this.touchTimeout) {\n clearTimeout(this.touchTimeout)\n }\n\n this.touchTimeout = setTimeout(event => this.cycle(event), TOUCHEVENT_COMPAT_WAIT + this._config.interval)\n }\n }\n\n SelectorEngine.find(SELECTOR_ITEM_IMG, this._element).forEach(itemImg => {\n EventHandler.on(itemImg, EVENT_DRAG_START, event => event.preventDefault())\n })\n\n if (this._pointerEvent) {\n EventHandler.on(this._element, EVENT_POINTERDOWN, event => start(event))\n EventHandler.on(this._element, EVENT_POINTERUP, event => end(event))\n\n this._element.classList.add(CLASS_NAME_POINTER_EVENT)\n } else {\n EventHandler.on(this._element, EVENT_TOUCHSTART, event => start(event))\n EventHandler.on(this._element, EVENT_TOUCHMOVE, event => move(event))\n EventHandler.on(this._element, EVENT_TOUCHEND, event => end(event))\n }\n }\n\n _keydown(event) {\n if (/input|textarea/i.test(event.target.tagName)) {\n return\n }\n\n const direction = KEY_TO_DIRECTION[event.key]\n if (direction) {\n event.preventDefault()\n this._slide(direction)\n }\n }\n\n _getItemIndex(element) {\n this._items = element && element.parentNode ?\n SelectorEngine.find(SELECTOR_ITEM, element.parentNode) :\n []\n\n return this._items.indexOf(element)\n }\n\n _getItemByOrder(order, activeElement) {\n const isNext = order === ORDER_NEXT\n return getNextActiveElement(this._items, activeElement, isNext, this._config.wrap)\n }\n\n _triggerSlideEvent(relatedTarget, eventDirectionName) {\n const targetIndex = this._getItemIndex(relatedTarget)\n const fromIndex = this._getItemIndex(SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element))\n\n return EventHandler.trigger(this._element, EVENT_SLIDE, {\n relatedTarget,\n direction: eventDirectionName,\n from: fromIndex,\n to: targetIndex\n })\n }\n\n _setActiveIndicatorElement(element) {\n if (this._indicatorsElement) {\n const activeIndicator = SelectorEngine.findOne(SELECTOR_ACTIVE, this._indicatorsElement)\n\n activeIndicator.classList.remove(CLASS_NAME_ACTIVE)\n activeIndicator.removeAttribute('aria-current')\n\n const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement)\n\n for (let i = 0; i < indicators.length; i++) {\n if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {\n indicators[i].classList.add(CLASS_NAME_ACTIVE)\n indicators[i].setAttribute('aria-current', 'true')\n break\n }\n }\n }\n }\n\n _updateInterval() {\n const element = this._activeElement || SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n\n if (!element) {\n return\n }\n\n const elementInterval = Number.parseInt(element.getAttribute('data-bs-interval'), 10)\n\n if (elementInterval) {\n this._config.defaultInterval = this._config.defaultInterval || this._config.interval\n this._config.interval = elementInterval\n } else {\n this._config.interval = this._config.defaultInterval || this._config.interval\n }\n }\n\n _slide(directionOrOrder, element) {\n const order = this._directionToOrder(directionOrOrder)\n const activeElement = SelectorEngine.findOne(SELECTOR_ACTIVE_ITEM, this._element)\n const activeElementIndex = this._getItemIndex(activeElement)\n const nextElement = element || this._getItemByOrder(order, activeElement)\n\n const nextElementIndex = this._getItemIndex(nextElement)\n const isCycling = Boolean(this._interval)\n\n const isNext = order === ORDER_NEXT\n const directionalClassName = isNext ? CLASS_NAME_START : CLASS_NAME_END\n const orderClassName = isNext ? CLASS_NAME_NEXT : CLASS_NAME_PREV\n const eventDirectionName = this._orderToDirection(order)\n\n if (nextElement && nextElement.classList.contains(CLASS_NAME_ACTIVE)) {\n this._isSliding = false\n return\n }\n\n if (this._isSliding) {\n return\n }\n\n const slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName)\n if (slideEvent.defaultPrevented) {\n return\n }\n\n if (!activeElement || !nextElement) {\n // Some weirdness is happening, so we bail\n return\n }\n\n this._isSliding = true\n\n if (isCycling) {\n this.pause()\n }\n\n this._setActiveIndicatorElement(nextElement)\n this._activeElement = nextElement\n\n const triggerSlidEvent = () => {\n EventHandler.trigger(this._element, EVENT_SLID, {\n relatedTarget: nextElement,\n direction: eventDirectionName,\n from: activeElementIndex,\n to: nextElementIndex\n })\n }\n\n if (this._element.classList.contains(CLASS_NAME_SLIDE)) {\n nextElement.classList.add(orderClassName)\n\n reflow(nextElement)\n\n activeElement.classList.add(directionalClassName)\n nextElement.classList.add(directionalClassName)\n\n const completeCallBack = () => {\n nextElement.classList.remove(directionalClassName, orderClassName)\n nextElement.classList.add(CLASS_NAME_ACTIVE)\n\n activeElement.classList.remove(CLASS_NAME_ACTIVE, orderClassName, directionalClassName)\n\n this._isSliding = false\n\n setTimeout(triggerSlidEvent, 0)\n }\n\n this._queueCallback(completeCallBack, activeElement, true)\n } else {\n activeElement.classList.remove(CLASS_NAME_ACTIVE)\n nextElement.classList.add(CLASS_NAME_ACTIVE)\n\n this._isSliding = false\n triggerSlidEvent()\n }\n\n if (isCycling) {\n this.cycle()\n }\n }\n\n _directionToOrder(direction) {\n if (![DIRECTION_RIGHT, DIRECTION_LEFT].includes(direction)) {\n return direction\n }\n\n if (isRTL()) {\n return direction === DIRECTION_LEFT ? ORDER_PREV : ORDER_NEXT\n }\n\n return direction === DIRECTION_LEFT ? ORDER_NEXT : ORDER_PREV\n }\n\n _orderToDirection(order) {\n if (![ORDER_NEXT, ORDER_PREV].includes(order)) {\n return order\n }\n\n if (isRTL()) {\n return order === ORDER_PREV ? DIRECTION_LEFT : DIRECTION_RIGHT\n }\n\n return order === ORDER_PREV ? DIRECTION_RIGHT : DIRECTION_LEFT\n }\n\n // Static\n\n static carouselInterface(element, config) {\n const data = Carousel.getOrCreateInstance(element, config)\n\n let { _config } = data\n if (typeof config === 'object') {\n _config = {\n ..._config,\n ...config\n }\n }\n\n const action = typeof config === 'string' ? config : _config.slide\n\n if (typeof config === 'number') {\n data.to(config)\n } else if (typeof action === 'string') {\n if (typeof data[action] === 'undefined') {\n throw new TypeError(`No method named \"${action}\"`)\n }\n\n data[action]()\n } else if (_config.interval && _config.ride) {\n data.pause()\n data.cycle()\n }\n }\n\n static jQueryInterface(config) {\n return this.each(function () {\n Carousel.carouselInterface(this, config)\n })\n }\n\n static dataApiClickHandler(event) {\n const target = getElementFromSelector(this)\n\n if (!target || !target.classList.contains(CLASS_NAME_CAROUSEL)) {\n return\n }\n\n const config = {\n ...Manipulator.getDataAttributes(target),\n ...Manipulator.getDataAttributes(this)\n }\n const slideIndex = this.getAttribute('data-bs-slide-to')\n\n if (slideIndex) {\n config.interval = false\n }\n\n Carousel.carouselInterface(target, config)\n\n if (slideIndex) {\n Carousel.getInstance(target).to(slideIndex)\n }\n\n event.preventDefault()\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.dataApiClickHandler)\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () => {\n const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)\n\n for (let i = 0, len = carousels.length; i < len; i++) {\n Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]))\n }\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Carousel to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Carousel)\n\nexport default Carousel\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): collapse.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n defineJQueryPlugin,\n getElement,\n getSelectorFromElement,\n getElementFromSelector,\n reflow,\n typeCheckConfig\n} from './util/index'\nimport Data from './dom/data'\nimport EventHandler from './dom/event-handler'\nimport Manipulator from './dom/manipulator'\nimport SelectorEngine from './dom/selector-engine'\nimport BaseComponent from './base-component'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'collapse'\nconst DATA_KEY = 'bs.collapse'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst Default = {\n toggle: true,\n parent: null\n}\n\nconst DefaultType = {\n toggle: 'boolean',\n parent: '(null|element)'\n}\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_COLLAPSE = 'collapse'\nconst CLASS_NAME_COLLAPSING = 'collapsing'\nconst CLASS_NAME_COLLAPSED = 'collapsed'\nconst CLASS_NAME_DEEPER_CHILDREN = `:scope .${CLASS_NAME_COLLAPSE} .${CLASS_NAME_COLLAPSE}`\nconst CLASS_NAME_HORIZONTAL = 'collapse-horizontal'\n\nconst WIDTH = 'width'\nconst HEIGHT = 'height'\n\nconst SELECTOR_ACTIVES = '.collapse.show, .collapse.collapsing'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"collapse\"]'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Collapse extends BaseComponent {\n constructor(element, config) {\n super(element)\n\n this._isTransitioning = false\n this._config = this._getConfig(config)\n this._triggerArray = []\n\n const toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE)\n\n for (let i = 0, len = toggleList.length; i < len; i++) {\n const elem = toggleList[i]\n const selector = getSelectorFromElement(elem)\n const filterElement = SelectorEngine.find(selector)\n .filter(foundElem => foundElem === this._element)\n\n if (selector !== null && filterElement.length) {\n this._selector = selector\n this._triggerArray.push(elem)\n }\n }\n\n this._initializeChildren()\n\n if (!this._config.parent) {\n this._addAriaAndCollapsedClass(this._triggerArray, this._isShown())\n }\n\n if (this._config.toggle) {\n this.toggle()\n }\n }\n\n // Getters\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n toggle() {\n if (this._isShown()) {\n this.hide()\n } else {\n this.show()\n }\n }\n\n show() {\n if (this._isTransitioning || this._isShown()) {\n return\n }\n\n let actives = []\n let activesData\n\n if (this._config.parent) {\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)\n actives = SelectorEngine.find(SELECTOR_ACTIVES, this._config.parent).filter(elem => !children.includes(elem)) // remove children if greater depth\n }\n\n const container = SelectorEngine.findOne(this._selector)\n if (actives.length) {\n const tempActiveData = actives.find(elem => container !== elem)\n activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null\n\n if (activesData && activesData._isTransitioning) {\n return\n }\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_SHOW)\n if (startEvent.defaultPrevented) {\n return\n }\n\n actives.forEach(elemActive => {\n if (container !== elemActive) {\n Collapse.getOrCreateInstance(elemActive, { toggle: false }).hide()\n }\n\n if (!activesData) {\n Data.set(elemActive, DATA_KEY, null)\n }\n })\n\n const dimension = this._getDimension()\n\n this._element.classList.remove(CLASS_NAME_COLLAPSE)\n this._element.classList.add(CLASS_NAME_COLLAPSING)\n\n this._element.style[dimension] = 0\n\n this._addAriaAndCollapsedClass(this._triggerArray, true)\n this._isTransitioning = true\n\n const complete = () => {\n this._isTransitioning = false\n\n this._element.classList.remove(CLASS_NAME_COLLAPSING)\n this._element.classList.add(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n this._element.style[dimension] = ''\n\n EventHandler.trigger(this._element, EVENT_SHOWN)\n }\n\n const capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1)\n const scrollSize = `scroll${capitalizedDimension}`\n\n this._queueCallback(complete, this._element, true)\n this._element.style[dimension] = `${this._element[scrollSize]}px`\n }\n\n hide() {\n if (this._isTransitioning || !this._isShown()) {\n return\n }\n\n const startEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n if (startEvent.defaultPrevented) {\n return\n }\n\n const dimension = this._getDimension()\n\n this._element.style[dimension] = `${this._element.getBoundingClientRect()[dimension]}px`\n\n reflow(this._element)\n\n this._element.classList.add(CLASS_NAME_COLLAPSING)\n this._element.classList.remove(CLASS_NAME_COLLAPSE, CLASS_NAME_SHOW)\n\n const triggerArrayLength = this._triggerArray.length\n for (let i = 0; i < triggerArrayLength; i++) {\n const trigger = this._triggerArray[i]\n const elem = getElementFromSelector(trigger)\n\n if (elem && !this._isShown(elem)) {\n this._addAriaAndCollapsedClass([trigger], false)\n }\n }\n\n this._isTransitioning = true\n\n const complete = () => {\n this._isTransitioning = false\n this._element.classList.remove(CLASS_NAME_COLLAPSING)\n this._element.classList.add(CLASS_NAME_COLLAPSE)\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n }\n\n this._element.style[dimension] = ''\n\n this._queueCallback(complete, this._element, true)\n }\n\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW)\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...Manipulator.getDataAttributes(this._element),\n ...config\n }\n config.toggle = Boolean(config.toggle) // Coerce string values\n config.parent = getElement(config.parent)\n typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _getDimension() {\n return this._element.classList.contains(CLASS_NAME_HORIZONTAL) ? WIDTH : HEIGHT\n }\n\n _initializeChildren() {\n if (!this._config.parent) {\n return\n }\n\n const children = SelectorEngine.find(CLASS_NAME_DEEPER_CHILDREN, this._config.parent)\n SelectorEngine.find(SELECTOR_DATA_TOGGLE, this._config.parent).filter(elem => !children.includes(elem))\n .forEach(element => {\n const selected = getElementFromSelector(element)\n\n if (selected) {\n this._addAriaAndCollapsedClass([element], this._isShown(selected))\n }\n })\n }\n\n _addAriaAndCollapsedClass(triggerArray, isOpen) {\n if (!triggerArray.length) {\n return\n }\n\n triggerArray.forEach(elem => {\n if (isOpen) {\n elem.classList.remove(CLASS_NAME_COLLAPSED)\n } else {\n elem.classList.add(CLASS_NAME_COLLAPSED)\n }\n\n elem.setAttribute('aria-expanded', isOpen)\n })\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const _config = {}\n if (typeof config === 'string' && /show|hide/.test(config)) {\n _config.toggle = false\n }\n\n const data = Collapse.getOrCreateInstance(this, _config)\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n // preventDefault only for elements (which change the URL) not inside the collapsible element\n if (event.target.tagName === 'A' || (event.delegateTarget && event.delegateTarget.tagName === 'A')) {\n event.preventDefault()\n }\n\n const selector = getSelectorFromElement(this)\n const selectorElements = SelectorEngine.find(selector)\n\n selectorElements.forEach(element => {\n Collapse.getOrCreateInstance(element, { toggle: false }).toggle()\n })\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Collapse to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Collapse)\n\nexport default Collapse\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): dropdown.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\n\nimport {\n defineJQueryPlugin,\n getElement,\n getElementFromSelector,\n getNextActiveElement,\n isDisabled,\n isElement,\n isRTL,\n isVisible,\n noop,\n typeCheckConfig\n} from './util/index'\nimport EventHandler from './dom/event-handler'\nimport Manipulator from './dom/manipulator'\nimport SelectorEngine from './dom/selector-engine'\nimport BaseComponent from './base-component'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'dropdown'\nconst DATA_KEY = 'bs.dropdown'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst ESCAPE_KEY = 'Escape'\nconst SPACE_KEY = 'Space'\nconst TAB_KEY = 'Tab'\nconst ARROW_UP_KEY = 'ArrowUp'\nconst ARROW_DOWN_KEY = 'ArrowDown'\nconst RIGHT_MOUSE_BUTTON = 2 // MouseEvent.button value for the secondary button, usually the right button\n\nconst REGEXP_KEYDOWN = new RegExp(`${ARROW_UP_KEY}|${ARROW_DOWN_KEY}|${ESCAPE_KEY}`)\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DATA_API = `keydown${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYUP_DATA_API = `keyup${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_DROPUP = 'dropup'\nconst CLASS_NAME_DROPEND = 'dropend'\nconst CLASS_NAME_DROPSTART = 'dropstart'\nconst CLASS_NAME_NAVBAR = 'navbar'\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"dropdown\"]'\nconst SELECTOR_MENU = '.dropdown-menu'\nconst SELECTOR_NAVBAR_NAV = '.navbar-nav'\nconst SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'\n\nconst PLACEMENT_TOP = isRTL() ? 'top-end' : 'top-start'\nconst PLACEMENT_TOPEND = isRTL() ? 'top-start' : 'top-end'\nconst PLACEMENT_BOTTOM = isRTL() ? 'bottom-end' : 'bottom-start'\nconst PLACEMENT_BOTTOMEND = isRTL() ? 'bottom-start' : 'bottom-end'\nconst PLACEMENT_RIGHT = isRTL() ? 'left-start' : 'right-start'\nconst PLACEMENT_LEFT = isRTL() ? 'right-start' : 'left-start'\n\nconst Default = {\n offset: [0, 2],\n boundary: 'clippingParents',\n reference: 'toggle',\n display: 'dynamic',\n popperConfig: null,\n autoClose: true\n}\n\nconst DefaultType = {\n offset: '(array|string|function)',\n boundary: '(string|element)',\n reference: '(string|element|object)',\n display: 'string',\n popperConfig: '(null|object|function)',\n autoClose: '(boolean|string)'\n}\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Dropdown extends BaseComponent {\n constructor(element, config) {\n super(element)\n\n this._popper = null\n this._config = this._getConfig(config)\n this._menu = this._getMenuElement()\n this._inNavbar = this._detectNavbar()\n }\n\n // Getters\n\n static get Default() {\n return Default\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n toggle() {\n return this._isShown() ? this.hide() : this.show()\n }\n\n show() {\n if (isDisabled(this._element) || this._isShown(this._menu)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, relatedTarget)\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n const parent = Dropdown.getParentFromElement(this._element)\n // Totally disable Popper for Dropdowns in Navbar\n if (this._inNavbar) {\n Manipulator.setDataAttribute(this._menu, 'popper', 'none')\n } else {\n this._createPopper(parent)\n }\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement &&\n !parent.closest(SELECTOR_NAVBAR_NAV)) {\n [].concat(...document.body.children)\n .forEach(elem => EventHandler.on(elem, 'mouseover', noop))\n }\n\n this._element.focus()\n this._element.setAttribute('aria-expanded', true)\n\n this._menu.classList.add(CLASS_NAME_SHOW)\n this._element.classList.add(CLASS_NAME_SHOW)\n EventHandler.trigger(this._element, EVENT_SHOWN, relatedTarget)\n }\n\n hide() {\n if (isDisabled(this._element) || !this._isShown(this._menu)) {\n return\n }\n\n const relatedTarget = {\n relatedTarget: this._element\n }\n\n this._completeHide(relatedTarget)\n }\n\n dispose() {\n if (this._popper) {\n this._popper.destroy()\n }\n\n super.dispose()\n }\n\n update() {\n this._inNavbar = this._detectNavbar()\n if (this._popper) {\n this._popper.update()\n }\n }\n\n // Private\n\n _completeHide(relatedTarget) {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE, relatedTarget)\n if (hideEvent.defaultPrevented) {\n return\n }\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children)\n .forEach(elem => EventHandler.off(elem, 'mouseover', noop))\n }\n\n if (this._popper) {\n this._popper.destroy()\n }\n\n this._menu.classList.remove(CLASS_NAME_SHOW)\n this._element.classList.remove(CLASS_NAME_SHOW)\n this._element.setAttribute('aria-expanded', 'false')\n Manipulator.removeDataAttribute(this._menu, 'popper')\n EventHandler.trigger(this._element, EVENT_HIDDEN, relatedTarget)\n }\n\n _getConfig(config) {\n config = {\n ...this.constructor.Default,\n ...Manipulator.getDataAttributes(this._element),\n ...config\n }\n\n typeCheckConfig(NAME, config, this.constructor.DefaultType)\n\n if (typeof config.reference === 'object' && !isElement(config.reference) &&\n typeof config.reference.getBoundingClientRect !== 'function'\n ) {\n // Popper virtual elements require a getBoundingClientRect method\n throw new TypeError(`${NAME.toUpperCase()}: Option \"reference\" provided type \"object\" without a required \"getBoundingClientRect\" method.`)\n }\n\n return config\n }\n\n _createPopper(parent) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s dropdowns require Popper (https://popper.js.org)')\n }\n\n let referenceElement = this._element\n\n if (this._config.reference === 'parent') {\n referenceElement = parent\n } else if (isElement(this._config.reference)) {\n referenceElement = getElement(this._config.reference)\n } else if (typeof this._config.reference === 'object') {\n referenceElement = this._config.reference\n }\n\n const popperConfig = this._getPopperConfig()\n const isDisplayStatic = popperConfig.modifiers.find(modifier => modifier.name === 'applyStyles' && modifier.enabled === false)\n\n this._popper = Popper.createPopper(referenceElement, this._menu, popperConfig)\n\n if (isDisplayStatic) {\n Manipulator.setDataAttribute(this._menu, 'popper', 'static')\n }\n }\n\n _isShown(element = this._element) {\n return element.classList.contains(CLASS_NAME_SHOW)\n }\n\n _getMenuElement() {\n return SelectorEngine.next(this._element, SELECTOR_MENU)[0]\n }\n\n _getPlacement() {\n const parentDropdown = this._element.parentNode\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPEND)) {\n return PLACEMENT_RIGHT\n }\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPSTART)) {\n return PLACEMENT_LEFT\n }\n\n // We need to trim the value because custom properties can also include spaces\n const isEnd = getComputedStyle(this._menu).getPropertyValue('--bs-position').trim() === 'end'\n\n if (parentDropdown.classList.contains(CLASS_NAME_DROPUP)) {\n return isEnd ? PLACEMENT_TOPEND : PLACEMENT_TOP\n }\n\n return isEnd ? PLACEMENT_BOTTOMEND : PLACEMENT_BOTTOM\n }\n\n _detectNavbar() {\n return this._element.closest(`.${CLASS_NAME_NAVBAR}`) !== null\n }\n\n _getOffset() {\n const { offset } = this._config\n\n if (typeof offset === 'string') {\n return offset.split(',').map(val => Number.parseInt(val, 10))\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element)\n }\n\n return offset\n }\n\n _getPopperConfig() {\n const defaultBsPopperConfig = {\n placement: this._getPlacement(),\n modifiers: [{\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n },\n {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n }]\n }\n\n // Disable Popper if we have a static display\n if (this._config.display === 'static') {\n defaultBsPopperConfig.modifiers = [{\n name: 'applyStyles',\n enabled: false\n }]\n }\n\n return {\n ...defaultBsPopperConfig,\n ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)\n }\n }\n\n _selectMenuItem({ key, target }) {\n const items = SelectorEngine.find(SELECTOR_VISIBLE_ITEMS, this._menu).filter(isVisible)\n\n if (!items.length) {\n return\n }\n\n // if target isn't included in items (e.g. when expanding the dropdown)\n // allow cycling to get the last item in case key equals ARROW_UP_KEY\n getNextActiveElement(items, target, key === ARROW_DOWN_KEY, !items.includes(target)).focus()\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Dropdown.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n })\n }\n\n static clearMenus(event) {\n if (event && (event.button === RIGHT_MOUSE_BUTTON || (event.type === 'keyup' && event.key !== TAB_KEY))) {\n return\n }\n\n const toggles = SelectorEngine.find(SELECTOR_DATA_TOGGLE)\n\n for (let i = 0, len = toggles.length; i < len; i++) {\n const context = Dropdown.getInstance(toggles[i])\n if (!context || context._config.autoClose === false) {\n continue\n }\n\n if (!context._isShown()) {\n continue\n }\n\n const relatedTarget = {\n relatedTarget: context._element\n }\n\n if (event) {\n const composedPath = event.composedPath()\n const isMenuTarget = composedPath.includes(context._menu)\n if (\n composedPath.includes(context._element) ||\n (context._config.autoClose === 'inside' && !isMenuTarget) ||\n (context._config.autoClose === 'outside' && isMenuTarget)\n ) {\n continue\n }\n\n // Tab navigation through the dropdown menu or events from contained inputs shouldn't close the menu\n if (context._menu.contains(event.target) && ((event.type === 'keyup' && event.key === TAB_KEY) || /input|select|option|textarea|form/i.test(event.target.tagName))) {\n continue\n }\n\n if (event.type === 'click') {\n relatedTarget.clickEvent = event\n }\n }\n\n context._completeHide(relatedTarget)\n }\n }\n\n static getParentFromElement(element) {\n return getElementFromSelector(element) || element.parentNode\n }\n\n static dataApiKeydownHandler(event) {\n // If not input/textarea:\n // - And not a key in REGEXP_KEYDOWN => not a dropdown command\n // If input/textarea:\n // - If space key => not a dropdown command\n // - If key is other than escape\n // - If key is not up or down => not a dropdown command\n // - If trigger inside the menu => not a dropdown command\n if (/input|textarea/i.test(event.target.tagName) ?\n event.key === SPACE_KEY || (event.key !== ESCAPE_KEY &&\n ((event.key !== ARROW_DOWN_KEY && event.key !== ARROW_UP_KEY) ||\n event.target.closest(SELECTOR_MENU))) :\n !REGEXP_KEYDOWN.test(event.key)) {\n return\n }\n\n const isActive = this.classList.contains(CLASS_NAME_SHOW)\n\n if (!isActive && event.key === ESCAPE_KEY) {\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n\n if (isDisabled(this)) {\n return\n }\n\n const getToggleButton = this.matches(SELECTOR_DATA_TOGGLE) ? this : SelectorEngine.prev(this, SELECTOR_DATA_TOGGLE)[0]\n const instance = Dropdown.getOrCreateInstance(getToggleButton)\n\n if (event.key === ESCAPE_KEY) {\n instance.hide()\n return\n }\n\n if (event.key === ARROW_UP_KEY || event.key === ARROW_DOWN_KEY) {\n if (!isActive) {\n instance.show()\n }\n\n instance._selectMenuItem(event)\n return\n }\n\n if (!isActive || event.key === SPACE_KEY) {\n Dropdown.clearMenus()\n }\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown.dataApiKeydownHandler)\nEventHandler.on(document, EVENT_CLICK_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_KEYUP_DATA_API, Dropdown.clearMenus)\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n event.preventDefault()\n Dropdown.getOrCreateInstance(this).toggle()\n})\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Dropdown to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Dropdown)\n\nexport default Dropdown\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/scrollBar.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport SelectorEngine from '../dom/selector-engine'\nimport Manipulator from '../dom/manipulator'\nimport { isElement } from './index'\n\nconst SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'\nconst SELECTOR_STICKY_CONTENT = '.sticky-top'\n\nclass ScrollBarHelper {\n constructor() {\n this._element = document.body\n }\n\n getWidth() {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = document.documentElement.clientWidth\n return Math.abs(window.innerWidth - documentWidth)\n }\n\n hide() {\n const width = this.getWidth()\n this._disableOverFlow()\n // give padding to element to balance the hidden scrollbar width\n this._setElementAttributes(this._element, 'paddingRight', calculatedValue => calculatedValue + width)\n // trick: We adjust positive paddingRight and negative marginRight to sticky-top elements to keep showing fullwidth\n this._setElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight', calculatedValue => calculatedValue + width)\n this._setElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight', calculatedValue => calculatedValue - width)\n }\n\n _disableOverFlow() {\n this._saveInitialAttribute(this._element, 'overflow')\n this._element.style.overflow = 'hidden'\n }\n\n _setElementAttributes(selector, styleProp, callback) {\n const scrollbarWidth = this.getWidth()\n const manipulationCallBack = element => {\n if (element !== this._element && window.innerWidth > element.clientWidth + scrollbarWidth) {\n return\n }\n\n this._saveInitialAttribute(element, styleProp)\n const calculatedValue = window.getComputedStyle(element)[styleProp]\n element.style[styleProp] = `${callback(Number.parseFloat(calculatedValue))}px`\n }\n\n this._applyManipulationCallback(selector, manipulationCallBack)\n }\n\n reset() {\n this._resetElementAttributes(this._element, 'overflow')\n this._resetElementAttributes(this._element, 'paddingRight')\n this._resetElementAttributes(SELECTOR_FIXED_CONTENT, 'paddingRight')\n this._resetElementAttributes(SELECTOR_STICKY_CONTENT, 'marginRight')\n }\n\n _saveInitialAttribute(element, styleProp) {\n const actualValue = element.style[styleProp]\n if (actualValue) {\n Manipulator.setDataAttribute(element, styleProp, actualValue)\n }\n }\n\n _resetElementAttributes(selector, styleProp) {\n const manipulationCallBack = element => {\n const value = Manipulator.getDataAttribute(element, styleProp)\n if (typeof value === 'undefined') {\n element.style.removeProperty(styleProp)\n } else {\n Manipulator.removeDataAttribute(element, styleProp)\n element.style[styleProp] = value\n }\n }\n\n this._applyManipulationCallback(selector, manipulationCallBack)\n }\n\n _applyManipulationCallback(selector, callBack) {\n if (isElement(selector)) {\n callBack(selector)\n } else {\n SelectorEngine.find(selector, this._element).forEach(callBack)\n }\n }\n\n isOverflowing() {\n return this.getWidth() > 0\n }\n}\n\nexport default ScrollBarHelper\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/backdrop.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler'\nimport { execute, executeAfterTransition, getElement, reflow, typeCheckConfig } from './index'\n\nconst Default = {\n className: 'modal-backdrop',\n isVisible: true, // if false, we use the backdrop helper without adding any element to the dom\n isAnimated: false,\n rootElement: 'body', // give the choice to place backdrop under different elements\n clickCallback: null\n}\n\nconst DefaultType = {\n className: 'string',\n isVisible: 'boolean',\n isAnimated: 'boolean',\n rootElement: '(element|string)',\n clickCallback: '(function|null)'\n}\nconst NAME = 'backdrop'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\n\nconst EVENT_MOUSEDOWN = `mousedown.bs.${NAME}`\n\nclass Backdrop {\n constructor(config) {\n this._config = this._getConfig(config)\n this._isAppended = false\n this._element = null\n }\n\n show(callback) {\n if (!this._config.isVisible) {\n execute(callback)\n return\n }\n\n this._append()\n\n if (this._config.isAnimated) {\n reflow(this._getElement())\n }\n\n this._getElement().classList.add(CLASS_NAME_SHOW)\n\n this._emulateAnimation(() => {\n execute(callback)\n })\n }\n\n hide(callback) {\n if (!this._config.isVisible) {\n execute(callback)\n return\n }\n\n this._getElement().classList.remove(CLASS_NAME_SHOW)\n\n this._emulateAnimation(() => {\n this.dispose()\n execute(callback)\n })\n }\n\n // Private\n\n _getElement() {\n if (!this._element) {\n const backdrop = document.createElement('div')\n backdrop.className = this._config.className\n if (this._config.isAnimated) {\n backdrop.classList.add(CLASS_NAME_FADE)\n }\n\n this._element = backdrop\n }\n\n return this._element\n }\n\n _getConfig(config) {\n config = {\n ...Default,\n ...(typeof config === 'object' ? config : {})\n }\n\n // use getElement() with the default \"body\" to get a fresh Element on each instantiation\n config.rootElement = getElement(config.rootElement)\n typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _append() {\n if (this._isAppended) {\n return\n }\n\n this._config.rootElement.append(this._getElement())\n\n EventHandler.on(this._getElement(), EVENT_MOUSEDOWN, () => {\n execute(this._config.clickCallback)\n })\n\n this._isAppended = true\n }\n\n dispose() {\n if (!this._isAppended) {\n return\n }\n\n EventHandler.off(this._element, EVENT_MOUSEDOWN)\n\n this._element.remove()\n this._isAppended = false\n }\n\n _emulateAnimation(callback) {\n executeAfterTransition(callback, this._getElement(), this._config.isAnimated)\n }\n}\n\nexport default Backdrop\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/focustrap.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport EventHandler from '../dom/event-handler'\nimport SelectorEngine from '../dom/selector-engine'\nimport { typeCheckConfig } from './index'\n\nconst Default = {\n trapElement: null, // The element to trap focus inside of\n autofocus: true\n}\n\nconst DefaultType = {\n trapElement: 'element',\n autofocus: 'boolean'\n}\n\nconst NAME = 'focustrap'\nconst DATA_KEY = 'bs.focustrap'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst EVENT_FOCUSIN = `focusin${EVENT_KEY}`\nconst EVENT_KEYDOWN_TAB = `keydown.tab${EVENT_KEY}`\n\nconst TAB_KEY = 'Tab'\nconst TAB_NAV_FORWARD = 'forward'\nconst TAB_NAV_BACKWARD = 'backward'\n\nclass FocusTrap {\n constructor(config) {\n this._config = this._getConfig(config)\n this._isActive = false\n this._lastTabNavDirection = null\n }\n\n activate() {\n const { trapElement, autofocus } = this._config\n\n if (this._isActive) {\n return\n }\n\n if (autofocus) {\n trapElement.focus()\n }\n\n EventHandler.off(document, EVENT_KEY) // guard against infinite focus loop\n EventHandler.on(document, EVENT_FOCUSIN, event => this._handleFocusin(event))\n EventHandler.on(document, EVENT_KEYDOWN_TAB, event => this._handleKeydown(event))\n\n this._isActive = true\n }\n\n deactivate() {\n if (!this._isActive) {\n return\n }\n\n this._isActive = false\n EventHandler.off(document, EVENT_KEY)\n }\n\n // Private\n\n _handleFocusin(event) {\n const { target } = event\n const { trapElement } = this._config\n\n if (target === document || target === trapElement || trapElement.contains(target)) {\n return\n }\n\n const elements = SelectorEngine.focusableChildren(trapElement)\n\n if (elements.length === 0) {\n trapElement.focus()\n } else if (this._lastTabNavDirection === TAB_NAV_BACKWARD) {\n elements[elements.length - 1].focus()\n } else {\n elements[0].focus()\n }\n }\n\n _handleKeydown(event) {\n if (event.key !== TAB_KEY) {\n return\n }\n\n this._lastTabNavDirection = event.shiftKey ? TAB_NAV_BACKWARD : TAB_NAV_FORWARD\n }\n\n _getConfig(config) {\n config = {\n ...Default,\n ...(typeof config === 'object' ? config : {})\n }\n typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n}\n\nexport default FocusTrap\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): modal.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n defineJQueryPlugin,\n getElementFromSelector,\n isRTL,\n isVisible,\n reflow,\n typeCheckConfig\n} from './util/index'\nimport EventHandler from './dom/event-handler'\nimport Manipulator from './dom/manipulator'\nimport SelectorEngine from './dom/selector-engine'\nimport ScrollBarHelper from './util/scrollbar'\nimport BaseComponent from './base-component'\nimport Backdrop from './util/backdrop'\nimport FocusTrap from './util/focustrap'\nimport { enableDismissTrigger } from './util/component-functions'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'modal'\nconst DATA_KEY = 'bs.modal'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst ESCAPE_KEY = 'Escape'\n\nconst Default = {\n backdrop: true,\n keyboard: true,\n focus: true\n}\n\nconst DefaultType = {\n backdrop: '(boolean|string)',\n keyboard: 'boolean',\n focus: 'boolean'\n}\n\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDE_PREVENTED = `hidePrevented${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_RESIZE = `resize${EVENT_KEY}`\nconst EVENT_CLICK_DISMISS = `click.dismiss${EVENT_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\nconst EVENT_MOUSEUP_DISMISS = `mouseup.dismiss${EVENT_KEY}`\nconst EVENT_MOUSEDOWN_DISMISS = `mousedown.dismiss${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_OPEN = 'modal-open'\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_STATIC = 'modal-static'\n\nconst OPEN_SELECTOR = '.modal.show'\nconst SELECTOR_DIALOG = '.modal-dialog'\nconst SELECTOR_MODAL_BODY = '.modal-body'\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"modal\"]'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Modal extends BaseComponent {\n constructor(element, config) {\n super(element)\n\n this._config = this._getConfig(config)\n this._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, this._element)\n this._backdrop = this._initializeBackDrop()\n this._focustrap = this._initializeFocusTrap()\n this._isShown = false\n this._ignoreBackdropClick = false\n this._isTransitioning = false\n this._scrollBar = new ScrollBarHelper()\n }\n\n // Getters\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown || this._isTransitioning) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, {\n relatedTarget\n })\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._isShown = true\n\n if (this._isAnimated()) {\n this._isTransitioning = true\n }\n\n this._scrollBar.hide()\n\n document.body.classList.add(CLASS_NAME_OPEN)\n\n this._adjustDialog()\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n EventHandler.on(this._dialog, EVENT_MOUSEDOWN_DISMISS, () => {\n EventHandler.one(this._element, EVENT_MOUSEUP_DISMISS, event => {\n if (event.target === this._element) {\n this._ignoreBackdropClick = true\n }\n })\n })\n\n this._showBackdrop(() => this._showElement(relatedTarget))\n }\n\n hide() {\n if (!this._isShown || this._isTransitioning) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n if (hideEvent.defaultPrevented) {\n return\n }\n\n this._isShown = false\n const isAnimated = this._isAnimated()\n\n if (isAnimated) {\n this._isTransitioning = true\n }\n\n this._setEscapeEvent()\n this._setResizeEvent()\n\n this._focustrap.deactivate()\n\n this._element.classList.remove(CLASS_NAME_SHOW)\n\n EventHandler.off(this._element, EVENT_CLICK_DISMISS)\n EventHandler.off(this._dialog, EVENT_MOUSEDOWN_DISMISS)\n\n this._queueCallback(() => this._hideModal(), this._element, isAnimated)\n }\n\n dispose() {\n [window, this._dialog]\n .forEach(htmlElement => EventHandler.off(htmlElement, EVENT_KEY))\n\n this._backdrop.dispose()\n this._focustrap.deactivate()\n super.dispose()\n }\n\n handleUpdate() {\n this._adjustDialog()\n }\n\n // Private\n\n _initializeBackDrop() {\n return new Backdrop({\n isVisible: Boolean(this._config.backdrop), // 'static' option will be translated to true, and booleans will keep their value\n isAnimated: this._isAnimated()\n })\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n })\n }\n\n _getConfig(config) {\n config = {\n ...Default,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n }\n typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _showElement(relatedTarget) {\n const isAnimated = this._isAnimated()\n const modalBody = SelectorEngine.findOne(SELECTOR_MODAL_BODY, this._dialog)\n\n if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) {\n // Don't move modal's DOM position\n document.body.append(this._element)\n }\n\n this._element.style.display = 'block'\n this._element.removeAttribute('aria-hidden')\n this._element.setAttribute('aria-modal', true)\n this._element.setAttribute('roleDto', 'dialog')\n this._element.scrollTop = 0\n\n if (modalBody) {\n modalBody.scrollTop = 0\n }\n\n if (isAnimated) {\n reflow(this._element)\n }\n\n this._element.classList.add(CLASS_NAME_SHOW)\n\n const transitionComplete = () => {\n if (this._config.focus) {\n this._focustrap.activate()\n }\n\n this._isTransitioning = false\n EventHandler.trigger(this._element, EVENT_SHOWN, {\n relatedTarget\n })\n }\n\n this._queueCallback(transitionComplete, this._dialog, isAnimated)\n }\n\n _setEscapeEvent() {\n if (this._isShown) {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (this._config.keyboard && event.key === ESCAPE_KEY) {\n event.preventDefault()\n this.hide()\n } else if (!this._config.keyboard && event.key === ESCAPE_KEY) {\n this._triggerBackdropTransition()\n }\n })\n } else {\n EventHandler.off(this._element, EVENT_KEYDOWN_DISMISS)\n }\n }\n\n _setResizeEvent() {\n if (this._isShown) {\n EventHandler.on(window, EVENT_RESIZE, () => this._adjustDialog())\n } else {\n EventHandler.off(window, EVENT_RESIZE)\n }\n }\n\n _hideModal() {\n this._element.style.display = 'none'\n this._element.setAttribute('aria-hidden', true)\n this._element.removeAttribute('aria-modal')\n this._element.removeAttribute('roleDto')\n this._isTransitioning = false\n this._backdrop.hide(() => {\n document.body.classList.remove(CLASS_NAME_OPEN)\n this._resetAdjustments()\n this._scrollBar.reset()\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n })\n }\n\n _showBackdrop(callback) {\n EventHandler.on(this._element, EVENT_CLICK_DISMISS, event => {\n if (this._ignoreBackdropClick) {\n this._ignoreBackdropClick = false\n return\n }\n\n if (event.target !== event.currentTarget) {\n return\n }\n\n if (this._config.backdrop === true) {\n this.hide()\n } else if (this._config.backdrop === 'static') {\n this._triggerBackdropTransition()\n }\n })\n\n this._backdrop.show(callback)\n }\n\n _isAnimated() {\n return this._element.classList.contains(CLASS_NAME_FADE)\n }\n\n _triggerBackdropTransition() {\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE_PREVENTED)\n if (hideEvent.defaultPrevented) {\n return\n }\n\n const { classList, scrollHeight, style } = this._element\n const isModalOverflowing = scrollHeight > document.documentElement.clientHeight\n\n // return if the following background transition hasn't yet completed\n if ((!isModalOverflowing && style.overflowY === 'hidden') || classList.contains(CLASS_NAME_STATIC)) {\n return\n }\n\n if (!isModalOverflowing) {\n style.overflowY = 'hidden'\n }\n\n classList.add(CLASS_NAME_STATIC)\n this._queueCallback(() => {\n classList.remove(CLASS_NAME_STATIC)\n if (!isModalOverflowing) {\n this._queueCallback(() => {\n style.overflowY = ''\n }, this._dialog)\n }\n }, this._dialog)\n\n this._element.focus()\n }\n\n // ----------------------------------------------------------------------\n // the following methods are used to handle overflowing modals\n // ----------------------------------------------------------------------\n\n _adjustDialog() {\n const isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight\n const scrollbarWidth = this._scrollBar.getWidth()\n const isBodyOverflowing = scrollbarWidth > 0\n\n if ((!isBodyOverflowing && isModalOverflowing && !isRTL()) || (isBodyOverflowing && !isModalOverflowing && isRTL())) {\n this._element.style.paddingLeft = `${scrollbarWidth}px`\n }\n\n if ((isBodyOverflowing && !isModalOverflowing && !isRTL()) || (!isBodyOverflowing && isModalOverflowing && isRTL())) {\n this._element.style.paddingRight = `${scrollbarWidth}px`\n }\n }\n\n _resetAdjustments() {\n this._element.style.paddingLeft = ''\n this._element.style.paddingRight = ''\n }\n\n // Static\n\n static jQueryInterface(config, relatedTarget) {\n return this.each(function () {\n const data = Modal.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](relatedTarget)\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n const target = getElementFromSelector(this)\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n EventHandler.one(target, EVENT_SHOW, showEvent => {\n if (showEvent.defaultPrevented) {\n // only register focus restorer if modal will actually get shown\n return\n }\n\n EventHandler.one(target, EVENT_HIDDEN, () => {\n if (isVisible(this)) {\n this.focus()\n }\n })\n })\n\n // avoid conflict when clicking moddal toggler while another one is open\n const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n if (allReadyOpen) {\n Modal.getInstance(allReadyOpen).hide()\n }\n\n const data = Modal.getOrCreateInstance(target)\n\n data.toggle(this)\n})\n\nenableDismissTrigger(Modal)\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Modal to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Modal)\n\nexport default Modal\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): offcanvas.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n defineJQueryPlugin,\n getElementFromSelector,\n isDisabled,\n isVisible,\n typeCheckConfig\n} from './util/index'\nimport ScrollBarHelper from './util/scrollbar'\nimport EventHandler from './dom/event-handler'\nimport BaseComponent from './base-component'\nimport SelectorEngine from './dom/selector-engine'\nimport Manipulator from './dom/manipulator'\nimport Backdrop from './util/backdrop'\nimport FocusTrap from './util/focustrap'\nimport { enableDismissTrigger } from './util/component-functions'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'offcanvas'\nconst DATA_KEY = 'bs.offcanvas'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\nconst ESCAPE_KEY = 'Escape'\n\nconst Default = {\n backdrop: true,\n keyboard: true,\n scroll: false\n}\n\nconst DefaultType = {\n backdrop: 'boolean',\n keyboard: 'boolean',\n scroll: 'boolean'\n}\n\nconst CLASS_NAME_SHOW = 'show'\nconst CLASS_NAME_BACKDROP = 'offcanvas-backdrop'\nconst OPEN_SELECTOR = '.offcanvas.show'\n\nconst EVENT_SHOW = `show${EVENT_KEY}`\nconst EVENT_SHOWN = `shown${EVENT_KEY}`\nconst EVENT_HIDE = `hide${EVENT_KEY}`\nconst EVENT_HIDDEN = `hidden${EVENT_KEY}`\nconst EVENT_CLICK_DATA_API = `click${EVENT_KEY}${DATA_API_KEY}`\nconst EVENT_KEYDOWN_DISMISS = `keydown.dismiss${EVENT_KEY}`\n\nconst SELECTOR_DATA_TOGGLE = '[data-bs-toggle=\"offcanvas\"]'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Offcanvas extends BaseComponent {\n constructor(element, config) {\n super(element)\n\n this._config = this._getConfig(config)\n this._isShown = false\n this._backdrop = this._initializeBackDrop()\n this._focustrap = this._initializeFocusTrap()\n this._addEventListeners()\n }\n\n // Getters\n\n static get NAME() {\n return NAME\n }\n\n static get Default() {\n return Default\n }\n\n // Public\n\n toggle(relatedTarget) {\n return this._isShown ? this.hide() : this.show(relatedTarget)\n }\n\n show(relatedTarget) {\n if (this._isShown) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, EVENT_SHOW, { relatedTarget })\n\n if (showEvent.defaultPrevented) {\n return\n }\n\n this._isShown = true\n this._element.style.visibility = 'visible'\n\n this._backdrop.show()\n\n if (!this._config.scroll) {\n new ScrollBarHelper().hide()\n }\n\n this._element.removeAttribute('aria-hidden')\n this._element.setAttribute('aria-modal', true)\n this._element.setAttribute('roleDto', 'dialog')\n this._element.classList.add(CLASS_NAME_SHOW)\n\n const completeCallBack = () => {\n if (!this._config.scroll) {\n this._focustrap.activate()\n }\n\n EventHandler.trigger(this._element, EVENT_SHOWN, { relatedTarget })\n }\n\n this._queueCallback(completeCallBack, this._element, true)\n }\n\n hide() {\n if (!this._isShown) {\n return\n }\n\n const hideEvent = EventHandler.trigger(this._element, EVENT_HIDE)\n\n if (hideEvent.defaultPrevented) {\n return\n }\n\n this._focustrap.deactivate()\n this._element.blur()\n this._isShown = false\n this._element.classList.remove(CLASS_NAME_SHOW)\n this._backdrop.hide()\n\n const completeCallback = () => {\n this._element.setAttribute('aria-hidden', true)\n this._element.removeAttribute('aria-modal')\n this._element.removeAttribute('roleDto')\n this._element.style.visibility = 'hidden'\n\n if (!this._config.scroll) {\n new ScrollBarHelper().reset()\n }\n\n EventHandler.trigger(this._element, EVENT_HIDDEN)\n }\n\n this._queueCallback(completeCallback, this._element, true)\n }\n\n dispose() {\n this._backdrop.dispose()\n this._focustrap.deactivate()\n super.dispose()\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' ? config : {})\n }\n typeCheckConfig(NAME, config, DefaultType)\n return config\n }\n\n _initializeBackDrop() {\n return new Backdrop({\n className: CLASS_NAME_BACKDROP,\n isVisible: this._config.backdrop,\n isAnimated: true,\n rootElement: this._element.parentNode,\n clickCallback: () => this.hide()\n })\n }\n\n _initializeFocusTrap() {\n return new FocusTrap({\n trapElement: this._element\n })\n }\n\n _addEventListeners() {\n EventHandler.on(this._element, EVENT_KEYDOWN_DISMISS, event => {\n if (this._config.keyboard && event.key === ESCAPE_KEY) {\n this.hide()\n }\n })\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Offcanvas.getOrCreateInstance(this, config)\n\n if (typeof config !== 'string') {\n return\n }\n\n if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config](this)\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * Data Api implementation\n * ------------------------------------------------------------------------\n */\n\nEventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) {\n const target = getElementFromSelector(this)\n\n if (['A', 'AREA'].includes(this.tagName)) {\n event.preventDefault()\n }\n\n if (isDisabled(this)) {\n return\n }\n\n EventHandler.one(target, EVENT_HIDDEN, () => {\n // focus on trigger when it is closed\n if (isVisible(this)) {\n this.focus()\n }\n })\n\n // avoid conflict when clicking a toggler of an offcanvas, while another is open\n const allReadyOpen = SelectorEngine.findOne(OPEN_SELECTOR)\n if (allReadyOpen && allReadyOpen !== target) {\n Offcanvas.getInstance(allReadyOpen).hide()\n }\n\n const data = Offcanvas.getOrCreateInstance(target)\n data.toggle(this)\n})\n\nEventHandler.on(window, EVENT_LOAD_DATA_API, () =>\n SelectorEngine.find(OPEN_SELECTOR).forEach(el => Offcanvas.getOrCreateInstance(el).show())\n)\n\nenableDismissTrigger(Offcanvas)\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n */\n\ndefineJQueryPlugin(Offcanvas)\n\nexport default Offcanvas\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): util/sanitizer.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nconst uriAttributes = new Set([\n 'background',\n 'cite',\n 'href',\n 'itemtype',\n 'longdesc',\n 'poster',\n 'src',\n 'xlink:href'\n])\n\nconst ARIA_ATTRIBUTE_PATTERN = /^aria-[\\w-]*$/i\n\n/**\n * A pattern that recognizes a commonly useful subset of URLs that are safe.\n *\n * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i\n\n/**\n * A pattern that matches safe data URLs. Only matches image, video and audio types.\n *\n * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts\n */\nconst DATA_URL_PATTERN = /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[\\d+/a-z]+=*$/i\n\nconst allowedAttribute = (attribute, allowedAttributeList) => {\n const attributeName = attribute.nodeName.toLowerCase()\n\n if (allowedAttributeList.includes(attributeName)) {\n if (uriAttributes.has(attributeName)) {\n return Boolean(SAFE_URL_PATTERN.test(attribute.nodeValue) || DATA_URL_PATTERN.test(attribute.nodeValue))\n }\n\n return true\n }\n\n const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)\n\n // Check if a regular expression validates the attribute.\n for (let i = 0, len = regExp.length; i < len; i++) {\n if (regExp[i].test(attributeName)) {\n return true\n }\n }\n\n return false\n}\n\nexport const DefaultAllowlist = {\n // Global attributes allowed on any supplied element below.\n '*': ['class', 'dir', 'id', 'lang', 'roleDto', ARIA_ATTRIBUTE_PATTERN],\n a: ['target', 'href', 'title', 'rel'],\n area: [],\n b: [],\n br: [],\n col: [],\n code: [],\n div: [],\n em: [],\n hr: [],\n h1: [],\n h2: [],\n h3: [],\n h4: [],\n h5: [],\n h6: [],\n i: [],\n img: ['src', 'srcset', 'alt', 'title', 'width', 'height'],\n li: [],\n ol: [],\n p: [],\n pre: [],\n s: [],\n small: [],\n span: [],\n sub: [],\n sup: [],\n strong: [],\n u: [],\n ul: []\n}\n\nexport function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {\n if (!unsafeHtml.length) {\n return unsafeHtml\n }\n\n if (sanitizeFn && typeof sanitizeFn === 'function') {\n return sanitizeFn(unsafeHtml)\n }\n\n const domParser = new window.DOMParser()\n const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')\n const elements = [].concat(...createdDocument.body.querySelectorAll('*'))\n\n for (let i = 0, len = elements.length; i < len; i++) {\n const element = elements[i]\n const elementName = element.nodeName.toLowerCase()\n\n if (!Object.keys(allowList).includes(elementName)) {\n element.remove()\n\n continue\n }\n\n const attributeList = [].concat(...element.attributes)\n const allowedAttributes = [].concat(allowList['*'] || [], allowList[elementName] || [])\n\n attributeList.forEach(attribute => {\n if (!allowedAttribute(attribute, allowedAttributes)) {\n element.removeAttribute(attribute.nodeName)\n }\n })\n }\n\n return createdDocument.body.innerHTML\n}\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): tooltip.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport * as Popper from '@popperjs/core'\n\nimport {\n defineJQueryPlugin,\n findShadowRoot,\n getElement,\n getUID,\n isElement,\n isRTL,\n noop,\n typeCheckConfig\n} from './util/index'\nimport { DefaultAllowlist, sanitizeHtml } from './util/sanitizer'\nimport Data from './dom/data'\nimport EventHandler from './dom/event-handler'\nimport Manipulator from './dom/manipulator'\nimport SelectorEngine from './dom/selector-engine'\nimport BaseComponent from './base-component'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'tooltip'\nconst DATA_KEY = 'bs.tooltip'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst CLASS_PREFIX = 'bs-tooltip'\nconst DISALLOWED_ATTRIBUTES = new Set(['sanitize', 'allowList', 'sanitizeFn'])\n\nconst DefaultType = {\n animation: 'boolean',\n template: 'string',\n title: '(string|element|function)',\n trigger: 'string',\n delay: '(number|object)',\n html: 'boolean',\n selector: '(string|boolean)',\n placement: '(string|function)',\n offset: '(array|string|function)',\n container: '(string|element|boolean)',\n fallbackPlacements: 'array',\n boundary: '(string|element)',\n customClass: '(string|function)',\n sanitize: 'boolean',\n sanitizeFn: '(null|function)',\n allowList: 'object',\n popperConfig: '(null|object|function)'\n}\n\nconst AttachmentMap = {\n AUTO: 'auto',\n TOP: 'top',\n RIGHT: isRTL() ? 'left' : 'right',\n BOTTOM: 'bottom',\n LEFT: isRTL() ? 'right' : 'left'\n}\n\nconst Default = {\n animation: true,\n template: '
    ' +\n '
    ' +\n '
    ' +\n '
    ',\n trigger: 'hover focus',\n title: '',\n delay: 0,\n html: false,\n selector: false,\n placement: 'top',\n offset: [0, 0],\n container: false,\n fallbackPlacements: ['top', 'right', 'bottom', 'left'],\n boundary: 'clippingParents',\n customClass: '',\n sanitize: true,\n sanitizeFn: null,\n allowList: DefaultAllowlist,\n popperConfig: null\n}\n\nconst Event = {\n HIDE: `hide${EVENT_KEY}`,\n HIDDEN: `hidden${EVENT_KEY}`,\n SHOW: `show${EVENT_KEY}`,\n SHOWN: `shown${EVENT_KEY}`,\n INSERTED: `inserted${EVENT_KEY}`,\n CLICK: `click${EVENT_KEY}`,\n FOCUSIN: `focusin${EVENT_KEY}`,\n FOCUSOUT: `focusout${EVENT_KEY}`,\n MOUSEENTER: `mouseenter${EVENT_KEY}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY}`\n}\n\nconst CLASS_NAME_FADE = 'fade'\nconst CLASS_NAME_MODAL = 'modal'\nconst CLASS_NAME_SHOW = 'show'\n\nconst HOVER_STATE_SHOW = 'show'\nconst HOVER_STATE_OUT = 'out'\n\nconst SELECTOR_TOOLTIP_INNER = '.tooltip-inner'\nconst SELECTOR_MODAL = `.${CLASS_NAME_MODAL}`\n\nconst EVENT_MODAL_HIDE = 'hide.bs.modal'\n\nconst TRIGGER_HOVER = 'hover'\nconst TRIGGER_FOCUS = 'focus'\nconst TRIGGER_CLICK = 'click'\nconst TRIGGER_MANUAL = 'manual'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Tooltip extends BaseComponent {\n constructor(element, config) {\n if (typeof Popper === 'undefined') {\n throw new TypeError('Bootstrap\\'s tooltips require Popper (https://popper.js.org)')\n }\n\n super(element)\n\n // private\n this._isEnabled = true\n this._timeout = 0\n this._hoverState = ''\n this._activeTrigger = {}\n this._popper = null\n\n // Protected\n this._config = this._getConfig(config)\n this.tip = null\n\n this._setListeners()\n }\n\n // Getters\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get Event() {\n return Event\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Public\n\n enable() {\n this._isEnabled = true\n }\n\n disable() {\n this._isEnabled = false\n }\n\n toggleEnabled() {\n this._isEnabled = !this._isEnabled\n }\n\n toggle(event) {\n if (!this._isEnabled) {\n return\n }\n\n if (event) {\n const context = this._initializeOnDelegatedTarget(event)\n\n context._activeTrigger.click = !context._activeTrigger.click\n\n if (context._isWithActiveTrigger()) {\n context._enter(null, context)\n } else {\n context._leave(null, context)\n }\n } else {\n if (this.getTipElement().classList.contains(CLASS_NAME_SHOW)) {\n this._leave(null, this)\n return\n }\n\n this._enter(null, this)\n }\n }\n\n dispose() {\n clearTimeout(this._timeout)\n\n EventHandler.off(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n\n if (this.tip) {\n this.tip.remove()\n }\n\n this._disposePopper()\n super.dispose()\n }\n\n show() {\n if (this._element.style.display === 'none') {\n throw new Error('Please use show on visible elements')\n }\n\n if (!(this.isWithContent() && this._isEnabled)) {\n return\n }\n\n const showEvent = EventHandler.trigger(this._element, this.constructor.Event.SHOW)\n const shadowRoot = findShadowRoot(this._element)\n const isInTheDom = shadowRoot === null ?\n this._element.ownerDocument.documentElement.contains(this._element) :\n shadowRoot.contains(this._element)\n\n if (showEvent.defaultPrevented || !isInTheDom) {\n return\n }\n\n // A trick to recreate a tooltip in case a new title is given by using the NOT documented `data-bs-original-title`\n // This will be removed later in favor of a `setContent` method\n if (this.constructor.NAME === 'tooltip' && this.tip && this.getTitle() !== this.tip.querySelector(SELECTOR_TOOLTIP_INNER).innerHTML) {\n this._disposePopper()\n this.tip.remove()\n this.tip = null\n }\n\n const tip = this.getTipElement()\n const tipId = getUID(this.constructor.NAME)\n\n tip.setAttribute('id', tipId)\n this._element.setAttribute('aria-describedby', tipId)\n\n if (this._config.animation) {\n tip.classList.add(CLASS_NAME_FADE)\n }\n\n const placement = typeof this._config.placement === 'function' ?\n this._config.placement.call(this, tip, this._element) :\n this._config.placement\n\n const attachment = this._getAttachment(placement)\n this._addAttachmentClass(attachment)\n\n const { container } = this._config\n Data.set(tip, this.constructor.DATA_KEY, this)\n\n if (!this._element.ownerDocument.documentElement.contains(this.tip)) {\n container.append(tip)\n EventHandler.trigger(this._element, this.constructor.Event.INSERTED)\n }\n\n if (this._popper) {\n this._popper.update()\n } else {\n this._popper = Popper.createPopper(this._element, tip, this._getPopperConfig(attachment))\n }\n\n tip.classList.add(CLASS_NAME_SHOW)\n\n const customClass = this._resolvePossibleFunction(this._config.customClass)\n if (customClass) {\n tip.classList.add(...customClass.split(' '))\n }\n\n // If this is a touch-enabled device we add extra\n // empty mouseover listeners to the body's immediate children;\n // only needed because of broken event delegation on iOS\n // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children).forEach(element => {\n EventHandler.on(element, 'mouseover', noop)\n })\n }\n\n const complete = () => {\n const prevHoverState = this._hoverState\n\n this._hoverState = null\n EventHandler.trigger(this._element, this.constructor.Event.SHOWN)\n\n if (prevHoverState === HOVER_STATE_OUT) {\n this._leave(null, this)\n }\n }\n\n const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE)\n this._queueCallback(complete, this.tip, isAnimated)\n }\n\n hide() {\n if (!this._popper) {\n return\n }\n\n const tip = this.getTipElement()\n const complete = () => {\n if (this._isWithActiveTrigger()) {\n return\n }\n\n if (this._hoverState !== HOVER_STATE_SHOW) {\n tip.remove()\n }\n\n this._cleanTipClass()\n this._element.removeAttribute('aria-describedby')\n EventHandler.trigger(this._element, this.constructor.Event.HIDDEN)\n\n this._disposePopper()\n }\n\n const hideEvent = EventHandler.trigger(this._element, this.constructor.Event.HIDE)\n if (hideEvent.defaultPrevented) {\n return\n }\n\n tip.classList.remove(CLASS_NAME_SHOW)\n\n // If this is a touch-enabled device we remove the extra\n // empty mouseover listeners we added for iOS support\n if ('ontouchstart' in document.documentElement) {\n [].concat(...document.body.children)\n .forEach(element => EventHandler.off(element, 'mouseover', noop))\n }\n\n this._activeTrigger[TRIGGER_CLICK] = false\n this._activeTrigger[TRIGGER_FOCUS] = false\n this._activeTrigger[TRIGGER_HOVER] = false\n\n const isAnimated = this.tip.classList.contains(CLASS_NAME_FADE)\n this._queueCallback(complete, this.tip, isAnimated)\n this._hoverState = ''\n }\n\n update() {\n if (this._popper !== null) {\n this._popper.update()\n }\n }\n\n // Protected\n\n isWithContent() {\n return Boolean(this.getTitle())\n }\n\n getTipElement() {\n if (this.tip) {\n return this.tip\n }\n\n const element = document.createElement('div')\n element.innerHTML = this._config.template\n\n const tip = element.children[0]\n this.setContent(tip)\n tip.classList.remove(CLASS_NAME_FADE, CLASS_NAME_SHOW)\n\n this.tip = tip\n return this.tip\n }\n\n setContent(tip) {\n this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TOOLTIP_INNER)\n }\n\n _sanitizeAndSetContent(template, content, selector) {\n const templateElement = SelectorEngine.findOne(selector, template)\n\n if (!content && templateElement) {\n templateElement.remove()\n return\n }\n\n // we use append for html objects to maintain js events\n this.setElementContent(templateElement, content)\n }\n\n setElementContent(element, content) {\n if (element === null) {\n return\n }\n\n if (isElement(content)) {\n content = getElement(content)\n\n // content is a DOM node or a jQuery\n if (this._config.html) {\n if (content.parentNode !== element) {\n element.innerHTML = ''\n element.append(content)\n }\n } else {\n element.textContent = content.textContent\n }\n\n return\n }\n\n if (this._config.html) {\n if (this._config.sanitize) {\n content = sanitizeHtml(content, this._config.allowList, this._config.sanitizeFn)\n }\n\n element.innerHTML = content\n } else {\n element.textContent = content\n }\n }\n\n getTitle() {\n const title = this._element.getAttribute('data-bs-original-title') || this._config.title\n\n return this._resolvePossibleFunction(title)\n }\n\n updateAttachment(attachment) {\n if (attachment === 'right') {\n return 'end'\n }\n\n if (attachment === 'left') {\n return 'start'\n }\n\n return attachment\n }\n\n // Private\n\n _initializeOnDelegatedTarget(event, context) {\n return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig())\n }\n\n _getOffset() {\n const { offset } = this._config\n\n if (typeof offset === 'string') {\n return offset.split(',').map(val => Number.parseInt(val, 10))\n }\n\n if (typeof offset === 'function') {\n return popperData => offset(popperData, this._element)\n }\n\n return offset\n }\n\n _resolvePossibleFunction(content) {\n return typeof content === 'function' ? content.call(this._element) : content\n }\n\n _getPopperConfig(attachment) {\n const defaultBsPopperConfig = {\n placement: attachment,\n modifiers: [\n {\n name: 'flip',\n options: {\n fallbackPlacements: this._config.fallbackPlacements\n }\n },\n {\n name: 'offset',\n options: {\n offset: this._getOffset()\n }\n },\n {\n name: 'preventOverflow',\n options: {\n boundary: this._config.boundary\n }\n },\n {\n name: 'arrow',\n options: {\n element: `.${this.constructor.NAME}-arrow`\n }\n },\n {\n name: 'onChange',\n enabled: true,\n phase: 'afterWrite',\n fn: data => this._handlePopperPlacementChange(data)\n }\n ],\n onFirstUpdate: data => {\n if (data.options.placement !== data.placement) {\n this._handlePopperPlacementChange(data)\n }\n }\n }\n\n return {\n ...defaultBsPopperConfig,\n ...(typeof this._config.popperConfig === 'function' ? this._config.popperConfig(defaultBsPopperConfig) : this._config.popperConfig)\n }\n }\n\n _addAttachmentClass(attachment) {\n this.getTipElement().classList.add(`${this._getBasicClassPrefix()}-${this.updateAttachment(attachment)}`)\n }\n\n _getAttachment(placement) {\n return AttachmentMap[placement.toUpperCase()]\n }\n\n _setListeners() {\n const triggers = this._config.trigger.split(' ')\n\n triggers.forEach(trigger => {\n if (trigger === 'click') {\n EventHandler.on(this._element, this.constructor.Event.CLICK, this._config.selector, event => this.toggle(event))\n } else if (trigger !== TRIGGER_MANUAL) {\n const eventIn = trigger === TRIGGER_HOVER ?\n this.constructor.Event.MOUSEENTER :\n this.constructor.Event.FOCUSIN\n const eventOut = trigger === TRIGGER_HOVER ?\n this.constructor.Event.MOUSELEAVE :\n this.constructor.Event.FOCUSOUT\n\n EventHandler.on(this._element, eventIn, this._config.selector, event => this._enter(event))\n EventHandler.on(this._element, eventOut, this._config.selector, event => this._leave(event))\n }\n })\n\n this._hideModalHandler = () => {\n if (this._element) {\n this.hide()\n }\n }\n\n EventHandler.on(this._element.closest(SELECTOR_MODAL), EVENT_MODAL_HIDE, this._hideModalHandler)\n\n if (this._config.selector) {\n this._config = {\n ...this._config,\n trigger: 'manual',\n selector: ''\n }\n } else {\n this._fixTitle()\n }\n }\n\n _fixTitle() {\n const title = this._element.getAttribute('title')\n const originalTitleType = typeof this._element.getAttribute('data-bs-original-title')\n\n if (title || originalTitleType !== 'string') {\n this._element.setAttribute('data-bs-original-title', title || '')\n if (title && !this._element.getAttribute('aria-label') && !this._element.textContent) {\n this._element.setAttribute('aria-label', title)\n }\n\n this._element.setAttribute('title', '')\n }\n }\n\n _enter(event, context) {\n context = this._initializeOnDelegatedTarget(event, context)\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER\n ] = true\n }\n\n if (context.getTipElement().classList.contains(CLASS_NAME_SHOW) || context._hoverState === HOVER_STATE_SHOW) {\n context._hoverState = HOVER_STATE_SHOW\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HOVER_STATE_SHOW\n\n if (!context._config.delay || !context._config.delay.show) {\n context.show()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HOVER_STATE_SHOW) {\n context.show()\n }\n }, context._config.delay.show)\n }\n\n _leave(event, context) {\n context = this._initializeOnDelegatedTarget(event, context)\n\n if (event) {\n context._activeTrigger[\n event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER\n ] = context._element.contains(event.relatedTarget)\n }\n\n if (context._isWithActiveTrigger()) {\n return\n }\n\n clearTimeout(context._timeout)\n\n context._hoverState = HOVER_STATE_OUT\n\n if (!context._config.delay || !context._config.delay.hide) {\n context.hide()\n return\n }\n\n context._timeout = setTimeout(() => {\n if (context._hoverState === HOVER_STATE_OUT) {\n context.hide()\n }\n }, context._config.delay.hide)\n }\n\n _isWithActiveTrigger() {\n for (const trigger in this._activeTrigger) {\n if (this._activeTrigger[trigger]) {\n return true\n }\n }\n\n return false\n }\n\n _getConfig(config) {\n const dataAttributes = Manipulator.getDataAttributes(this._element)\n\n Object.keys(dataAttributes).forEach(dataAttr => {\n if (DISALLOWED_ATTRIBUTES.has(dataAttr)) {\n delete dataAttributes[dataAttr]\n }\n })\n\n config = {\n ...this.constructor.Default,\n ...dataAttributes,\n ...(typeof config === 'object' && config ? config : {})\n }\n\n config.container = config.container === false ? document.body : getElement(config.container)\n\n if (typeof config.delay === 'number') {\n config.delay = {\n show: config.delay,\n hide: config.delay\n }\n }\n\n if (typeof config.title === 'number') {\n config.title = config.title.toString()\n }\n\n if (typeof config.content === 'number') {\n config.content = config.content.toString()\n }\n\n typeCheckConfig(NAME, config, this.constructor.DefaultType)\n\n if (config.sanitize) {\n config.template = sanitizeHtml(config.template, config.allowList, config.sanitizeFn)\n }\n\n return config\n }\n\n _getDelegateConfig() {\n const config = {}\n\n for (const key in this._config) {\n if (this.constructor.Default[key] !== this._config[key]) {\n config[key] = this._config[key]\n }\n }\n\n // In the future can be replaced with:\n // const keysWithDifferentValues = Object.entries(this._config).filter(entry => this.constructor.Default[entry[0]] !== this._config[entry[0]])\n // `Object.fromEntries(keysWithDifferentValues)`\n return config\n }\n\n _cleanTipClass() {\n const tip = this.getTipElement()\n const basicClassPrefixRegex = new RegExp(`(^|\\\\s)${this._getBasicClassPrefix()}\\\\S+`, 'g')\n const tabClass = tip.getAttribute('class').match(basicClassPrefixRegex)\n if (tabClass !== null && tabClass.length > 0) {\n tabClass.map(token => token.trim())\n .forEach(tClass => tip.classList.remove(tClass))\n }\n }\n\n _getBasicClassPrefix() {\n return CLASS_PREFIX\n }\n\n _handlePopperPlacementChange(popperData) {\n const { state } = popperData\n\n if (!state) {\n return\n }\n\n this.tip = state.elements.popper\n this._cleanTipClass()\n this._addAttachmentClass(this._getAttachment(state.placement))\n }\n\n _disposePopper() {\n if (this._popper) {\n this._popper.destroy()\n this._popper = null\n }\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Tooltip.getOrCreateInstance(this, config)\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Tooltip to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Tooltip)\n\nexport default Tooltip\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): popover.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport { defineJQueryPlugin } from './util/index'\nimport Tooltip from './tooltip'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'popover'\nconst DATA_KEY = 'bs.popover'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst CLASS_PREFIX = 'bs-popover'\n\nconst Default = {\n ...Tooltip.Default,\n placement: 'right',\n offset: [0, 8],\n trigger: 'click',\n content: '',\n template: '
    ' +\n '
    ' +\n '

    ' +\n '
    ' +\n '
    '\n}\n\nconst DefaultType = {\n ...Tooltip.DefaultType,\n content: '(string|element|function)'\n}\n\nconst Event = {\n HIDE: `hide${EVENT_KEY}`,\n HIDDEN: `hidden${EVENT_KEY}`,\n SHOW: `show${EVENT_KEY}`,\n SHOWN: `shown${EVENT_KEY}`,\n INSERTED: `inserted${EVENT_KEY}`,\n CLICK: `click${EVENT_KEY}`,\n FOCUSIN: `focusin${EVENT_KEY}`,\n FOCUSOUT: `focusout${EVENT_KEY}`,\n MOUSEENTER: `mouseenter${EVENT_KEY}`,\n MOUSELEAVE: `mouseleave${EVENT_KEY}`\n}\n\nconst SELECTOR_TITLE = '.popover-header'\nconst SELECTOR_CONTENT = '.popover-body'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass Popover extends Tooltip {\n // Getters\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n static get Event() {\n return Event\n }\n\n static get DefaultType() {\n return DefaultType\n }\n\n // Overrides\n\n isWithContent() {\n return this.getTitle() || this._getContent()\n }\n\n setContent(tip) {\n this._sanitizeAndSetContent(tip, this.getTitle(), SELECTOR_TITLE)\n this._sanitizeAndSetContent(tip, this._getContent(), SELECTOR_CONTENT)\n }\n\n // Private\n\n _getContent() {\n return this._resolvePossibleFunction(this._config.content)\n }\n\n _getBasicClassPrefix() {\n return CLASS_PREFIX\n }\n\n // Static\n\n static jQueryInterface(config) {\n return this.each(function () {\n const data = Popover.getOrCreateInstance(this, config)\n\n if (typeof config === 'string') {\n if (typeof data[config] === 'undefined') {\n throw new TypeError(`No method named \"${config}\"`)\n }\n\n data[config]()\n }\n })\n }\n}\n\n/**\n * ------------------------------------------------------------------------\n * jQuery\n * ------------------------------------------------------------------------\n * add .Popover to jQuery only if jQuery is present\n */\n\ndefineJQueryPlugin(Popover)\n\nexport default Popover\n","/**\n * --------------------------------------------------------------------------\n * Bootstrap (v5.1.3): scrollspy.js\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)\n * --------------------------------------------------------------------------\n */\n\nimport {\n defineJQueryPlugin,\n getElement,\n getSelectorFromElement,\n typeCheckConfig\n} from './util/index'\nimport EventHandler from './dom/event-handler'\nimport Manipulator from './dom/manipulator'\nimport SelectorEngine from './dom/selector-engine'\nimport BaseComponent from './base-component'\n\n/**\n * ------------------------------------------------------------------------\n * Constants\n * ------------------------------------------------------------------------\n */\n\nconst NAME = 'scrollspy'\nconst DATA_KEY = 'bs.scrollspy'\nconst EVENT_KEY = `.${DATA_KEY}`\nconst DATA_API_KEY = '.data-api'\n\nconst Default = {\n offset: 10,\n method: 'auto',\n target: ''\n}\n\nconst DefaultType = {\n offset: 'number',\n method: 'string',\n target: '(string|element)'\n}\n\nconst EVENT_ACTIVATE = `activate${EVENT_KEY}`\nconst EVENT_SCROLL = `scroll${EVENT_KEY}`\nconst EVENT_LOAD_DATA_API = `load${EVENT_KEY}${DATA_API_KEY}`\n\nconst CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'\nconst CLASS_NAME_ACTIVE = 'active'\n\nconst SELECTOR_DATA_SPY = '[data-bs-spy=\"scroll\"]'\nconst SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'\nconst SELECTOR_NAV_LINKS = '.nav-link'\nconst SELECTOR_NAV_ITEMS = '.nav-item'\nconst SELECTOR_LIST_ITEMS = '.list-group-item'\nconst SELECTOR_LINK_ITEMS = `${SELECTOR_NAV_LINKS}, ${SELECTOR_LIST_ITEMS}, .${CLASS_NAME_DROPDOWN_ITEM}`\nconst SELECTOR_DROPDOWN = '.dropdown'\nconst SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'\n\nconst METHOD_OFFSET = 'offset'\nconst METHOD_POSITION = 'position'\n\n/**\n * ------------------------------------------------------------------------\n * Class Definition\n * ------------------------------------------------------------------------\n */\n\nclass ScrollSpy extends BaseComponent {\n constructor(element, config) {\n super(element)\n this._scrollElement = this._element.tagName === 'BODY' ? window : this._element\n this._config = this._getConfig(config)\n this._offsets = []\n this._targets = []\n this._activeTarget = null\n this._scrollHeight = 0\n\n EventHandler.on(this._scrollElement, EVENT_SCROLL, () => this._process())\n\n this.refresh()\n this._process()\n }\n\n // Getters\n\n static get Default() {\n return Default\n }\n\n static get NAME() {\n return NAME\n }\n\n // Public\n\n refresh() {\n const autoMethod = this._scrollElement === this._scrollElement.window ?\n METHOD_OFFSET :\n METHOD_POSITION\n\n const offsetMethod = this._config.method === 'auto' ?\n autoMethod :\n this._config.method\n\n const offsetBase = offsetMethod === METHOD_POSITION ?\n this._getScrollTop() :\n 0\n\n this._offsets = []\n this._targets = []\n this._scrollHeight = this._getScrollHeight()\n\n const targets = SelectorEngine.find(SELECTOR_LINK_ITEMS, this._config.target)\n\n targets.map(element => {\n const targetSelector = getSelectorFromElement(element)\n const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null\n\n if (target) {\n const targetBCR = target.getBoundingClientRect()\n if (targetBCR.width || targetBCR.height) {\n return [\n Manipulator[offsetMethod](target).top + offsetBase,\n targetSelector\n ]\n }\n }\n\n return null\n })\n .filter(item => item)\n .sort((a, b) => a[0] - b[0])\n .forEach(item => {\n this._offsets.push(item[0])\n this._targets.push(item[1])\n })\n }\n\n dispose() {\n EventHandler.off(this._scrollElement, EVENT_KEY)\n super.dispose()\n }\n\n // Private\n\n _getConfig(config) {\n config = {\n ...Default,\n ...Manipulator.getDataAttributes(this._element),\n ...(typeof config === 'object' && config ? config : {})\n }\n\n config.target = getElement(config.target) || document.documentElement\n\n typeCheckConfig(NAME, config, DefaultType)\n\n return config\n }\n\n _getScrollTop() {\n return this._scrollElement === window ?\n this._scrollElement.pageYOffset :\n this._scrollElement.scrollTop\n }\n\n _getScrollHeight() {\n return this._scrollElement.scrollHeight || Math.max(\n document.body.scrollHeight,\n document.documentElement.scrollHeight\n )\n }\n\n _getOffsetHeight() {\n return this._scrollElement === window ?\n window.innerHeight :\n this._scrollElement.getBoundingClientRect().height\n }\n\n _process() {\n const scrollTop = this._getScrollTop() + this._config.offset\n const scrollHeight = this._getScrollHeight()\n const maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight()\n\n if (this._scrollHeight !== scrollHeight) {\n this.refresh()\n }\n\n if (scrollTop >= maxScroll) {\n const target = this._targets[this._targets.length - 1]\n\n if (this._activeTarget !== target) {\n this._activate(target)\n }\n\n return\n }\n\n if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) {\n this._activeTarget = null\n this._clear()\n return\n }\n\n for (let i = this._offsets.length; i--;) {\n const isActiveTarget = this._activeTarget !== this._targets[i] &&\n scrollTop >= this._offsets[i] &&\n (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1])\n\n if (isActiveTarget) {\n this._activate(this._targets[i])\n }\n }\n }\n\n _activate(target) {\n this._activeTarget = target\n\n this._clear()\n\n const queries = SELECTOR_LINK_ITEMS.split(',')\n .map(selector => `${selector}[data-bs-target=\"${target}\"],${selector}[href=\"${target}\"]`)\n\n const link = SelectorEngine.findOne(queries.join(','), this._config.target)\n\n link.classList.add(CLASS_NAME_ACTIVE)\n if (link.classList.contains(CLASS_NAME_DROPDOWN_ITEM)) {\n SelectorEngine.findOne(SELECTOR_DROPDOWN_TOGGLE, link.closest(SELECTOR_DROPDOWN))\n .classList.add(CLASS_NAME_ACTIVE)\n } else {\n SelectorEngine.parents(link, SELECTOR_NAV_LIST_GROUP)\n .forEach(listGroup => {\n // Set triggered links parents as active\n // With both
      and